diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 192491e0df..d9c82678eb 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -135,23 +135,20 @@ if(PKG_USER-ADIOS) target_link_libraries(lammps PRIVATE adios2::adios2) endif() -if (CMAKE_SYSTEM_NAME STREQUAL Windows) - option(BUILD_MPI "Build MPI version" OFF) -else() - # do MPI detection after language activation, - # in case MPI for these languages is required +if(NOT CMAKE_CROSSCOMPILING) set(MPI_CXX_SKIP_MPICXX TRUE) find_package(MPI QUIET) option(BUILD_MPI "Build MPI version" ${MPI_FOUND}) +else() + option(BUILD_MPI "Build MPI version" OFF) endif() if(BUILD_MPI) - # We use a non-standard procedure to compile with MPI on windows - if (CMAKE_SYSTEM_NAME STREQUAL Windows) + # We use a non-standard procedure to cross-compile with MPI on Windows + if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING) include(MPI4WIN) target_link_libraries(lammps PUBLIC MPI::MPI_CXX) else() - set(MPI_CXX_SKIP_MPICXX ON) find_package(MPI REQUIRED) target_link_libraries(lammps PUBLIC MPI::MPI_CXX) option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF) @@ -332,8 +329,9 @@ set(CMAKE_TUNE_FLAGS "${CMAKE_TUNE_DEFAULT}" CACHE STRING "Compiler specific opt separate_arguments(CMAKE_TUNE_FLAGS) include(CheckCXXCompilerFlag) foreach(_FLAG ${CMAKE_TUNE_FLAGS}) - check_cxx_compiler_flag("${_FLAG}" COMPILER_SUPPORTS${_FLAG}) - if(COMPILER_SUPPORTS${_FLAG}) + string(REGEX REPLACE "[=\"]" "" _FLAGX ${_FLAG}) + check_cxx_compiler_flag("${_FLAG}" COMPILER_SUPPORTS${_FLAGX}) + if(COMPILER_SUPPORTS${_FLAGX}) target_compile_options(lammps PRIVATE ${_FLAG}) else() message(WARNING "${_FLAG} found in CMAKE_TUNE_FLAGS, but not supported by the compiler, skipping") @@ -705,6 +703,7 @@ else() endif() if(BUILD_MPI) message(STATUS "<<< MPI flags >>> +-- MPI_defines: ${MPI_CXX_COMPILE_DEFINITIONS} -- MPI includes: ${MPI_CXX_INCLUDE_PATH} -- MPI libraries: ${MPI_CXX_LIBRARIES};${MPI_Fortran_LIBRARIES}") endif() diff --git a/cmake/Modules/MPI4WIN.cmake b/cmake/Modules/MPI4WIN.cmake index 19d2d2a13e..035c6a22f3 100644 --- a/cmake/Modules/MPI4WIN.cmake +++ b/cmake/Modules/MPI4WIN.cmake @@ -23,3 +23,8 @@ set_target_properties(MPI::MPI_CXX PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include" INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX") add_dependencies(MPI::MPI_CXX mpi4win_build) + +# set variables for status reporting at the end of CMake run +set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include") +set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX") +set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a") diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 574be941f7..9299914b9b 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -330,7 +330,7 @@ elseif(GPU_API STREQUAL "HIP") if(HIP_PLATFORM STREQUAL "nvcc") target_compile_definitions(gpu PRIVATE -D__HIP_PLATFORM_NVCC__) - target_include_directories(gpu PRIVATE ${HIP_ROOT_DIR}/include) + target_include_directories(gpu PRIVATE ${HIP_ROOT_DIR}/../include) target_include_directories(gpu PRIVATE ${CUDA_INCLUDE_DIRS}) target_link_libraries(gpu PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY}) @@ -338,6 +338,12 @@ elseif(GPU_API STREQUAL "HIP") target_include_directories(hip_get_devices PRIVATE ${HIP_ROOT_DIR}/include) target_include_directories(hip_get_devices PRIVATE ${CUDA_INCLUDE_DIRS}) target_link_libraries(hip_get_devices PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY}) + elseif(HIP_PLATFORM STREQUAL "hcc") + target_compile_definitions(gpu PRIVATE -D__HIP_PLATFORM_HCC__) + target_include_directories(gpu PRIVATE ${HIP_ROOT_DIR}/../include) + + target_compile_definitions(hip_get_devices PRIVATE -D__HIP_PLATFORM_HCC__) + target_include_directories(hip_get_devices PRIVATE ${HIP_ROOT_DIR}/../include) endif() target_link_libraries(lammps PRIVATE gpu) @@ -353,7 +359,12 @@ RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) -target_link_libraries(gpu PRIVATE MPI::MPI_CXX) +if(NOT BUILD_MPI) + # mpistubs is aliased to MPI::MPI_CXX, but older versions of cmake won't work forward the include path + target_link_libraries(gpu PRIVATE mpi_stubs) +else() + target_link_libraries(gpu PRIVATE MPI::MPI_CXX) +endif() if(NOT BUILD_SHARED_LIBS) install(TARGETS gpu EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() diff --git a/cmake/Modules/Packages/LATTE.cmake b/cmake/Modules/Packages/LATTE.cmake index 4ce8888f37..a2a94755ab 100644 --- a/cmake/Modules/Packages/LATTE.cmake +++ b/cmake/Modules/Packages/LATTE.cmake @@ -1,4 +1,11 @@ enable_language(Fortran) + +# using lammps in a super-build setting +if(TARGET LATTE::latte) + target_link_libraries(lammps PRIVATE LATTE::latte) + return() +endif() + find_package(LATTE) if(LATTE_FOUND) set(DOWNLOAD_LATTE_DEFAULT OFF) @@ -35,5 +42,6 @@ else() if(NOT LATTE_FOUND) message(FATAL_ERROR "LATTE library not found, help CMake to find it by setting LATTE_LIBRARY, or set DOWNLOAD_LATTE=ON to download it") endif() - target_link_libraries(lammps PRIVATE LATTE::latte) + # latte needs lapack + target_link_libraries(lammps PRIVATE LATTE::latte ${LAPACK_LIBRARIES}) endif() diff --git a/cmake/presets/clang.cmake b/cmake/presets/clang.cmake index e2b1e02cc9..bfc355669d 100644 --- a/cmake/presets/clang.cmake +++ b/cmake/presets/clang.cmake @@ -2,7 +2,7 @@ set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE) set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE) -set(CMAKE_CXX_FLAGS "-Wall -Wextra -g -O2 -DNDEBG" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) set(MPI_CXX "clang++" CACHE STRING "" FORCE) set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE) unset(HAVE_OMP_H_INCLUDE CACHE) diff --git a/cmake/presets/hip.cmake b/cmake/presets/hip.cmake new file mode 100644 index 0000000000..047c8e8eb0 --- /dev/null +++ b/cmake/presets/hip.cmake @@ -0,0 +1,12 @@ +# preset that will enable hipcc plus gcc with support for MPI and OpenMP (on Linux boxes) + +set(CMAKE_CXX_COMPILER "hipcc" CACHE STRING "" FORCE) +set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) +unset(HAVE_OMP_H_INCLUDE CACHE) + +set(OpenMP_CXX "hipcc" CACHE STRING "" FORCE) +set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE) +set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE) +set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE) + diff --git a/doc/src/Commands_compute.rst b/doc/src/Commands_compute.rst index 13336fa89b..1c46bfad6e 100644 --- a/doc/src/Commands_compute.rst +++ b/doc/src/Commands_compute.rst @@ -87,7 +87,7 @@ KOKKOS, o = USER-OMP, t = OPT. * :doc:`msd/chunk ` * :doc:`msd/nongauss ` * :doc:`omega/chunk ` - * :doc:`orientorder/atom ` + * :doc:`orientorder/atom (k) ` * :doc:`pair ` * :doc:`pair/local ` * :doc:`pe ` diff --git a/doc/src/Howto_cmake.rst b/doc/src/Howto_cmake.rst index db7b88dc3d..fa6038efb5 100644 --- a/doc/src/Howto_cmake.rst +++ b/doc/src/Howto_cmake.rst @@ -378,9 +378,9 @@ change some variables later with additional *-D* flags. A few examples: .. code-block:: bash - cmake -C ../cmake/preset/minimal.cmake -D PKG_MISC=on ../cmake - cmake -C ../cmake/preset/clang.cmake -C ../cmake/preset/most.cmake ../cmake - cmake -C ../cmake/preset/minimal.cmake -D BUILD_MPI=off ../cmake + cmake -C ../cmake/presets/minimal.cmake -D PKG_MISC=on ../cmake + cmake -C ../cmake/presets/clang.cmake -C ../cmake/presets/most.cmake ../cmake + cmake -C ../cmake/presets/minimal.cmake -D BUILD_MPI=off ../cmake The first command will install the packages ``KSPACE``, ``MANYBODY``, ``MOLECULE``, ``RIGID`` and ``MISC``; the first four from the preset @@ -396,7 +396,7 @@ It is also possible to do this incrementally. .. code-block:: bash - cmake -C ../cmake/preset/minimal.cmake ../cmake + cmake -C ../cmake/presets/minimal.cmake ../cmake cmake -D PKG_MISC=on . will achieve the same configuration like in the first example above. In diff --git a/doc/src/Install_linux.rst b/doc/src/Install_linux.rst index ec4f3fcc8e..ca3f794fc2 100644 --- a/doc/src/Install_linux.rst +++ b/doc/src/Install_linux.rst @@ -24,12 +24,13 @@ allows you to install LAMMPS with a single command, and stay up-to-date with the current version of LAMMPS by simply updating your operating system. -To install the appropriate personal-package archive (PPA), do the +To install the appropriate personal-package archives (PPAs), do the following once: .. code-block:: bash $ sudo add-apt-repository ppa:gladky-anton/lammps + $ sudo add-apt-repository ppa:openkim/latest $ sudo apt-get update To install LAMMPS do the following once: @@ -38,7 +39,7 @@ To install LAMMPS do the following once: $ sudo apt-get install lammps-daily -This downloads an executable named "lmp_daily" to your box, which +This downloads an executable named ``lmp_daily`` to your box, which can then be used in the usual way to run input scripts: .. code-block:: bash @@ -60,11 +61,29 @@ To get a copy of the current documentation and examples: $ sudo apt-get install lammps-daily-doc which will download the doc files in -/usr/share/doc/lammps-daily-doc/doc and example problems in -/usr/share/doc/lammps-doc/examples. +``/usr/share/doc/lammps-daily-doc/doc`` and example problems in +``/usr/share/doc/lammps-doc/examples``. -Note that you may still wish to download the tarball to get potential -files and auxiliary tools. +To get a copy of the current potentials files: + +.. code-block:: bash + + $ sudo apt-get install lammps-daily-data + +which will download the potentials files to +``/usr/share/lammps-daily/potentials``. The ``lmp_daily`` binary is +hard-coded to look for potential files in this directory (it does not +use the `LAMMPS_POTENTIALS` environment variable, as described +in :doc:`pair_coeff ` command). + +The ``lmp_daily`` binary is built with the :ref:`KIM package ` which +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 + +.. code-block:: bash + + $ sudo apt-get install openkim-models To un-install LAMMPS, do the following: @@ -72,17 +91,8 @@ To un-install LAMMPS, do the following: $ sudo apt-get remove lammps-daily -Note that the lammps-daily executable is built with the following -sequence of make commands, as if you had done the same with the -unpacked tarball files in the src directory: - -.. code-block:: bash - - $ make yes-all - $ make no-lib - $ make mpi - -Thus it builds with FFTW3 and OpenMPI. +Please use ``lmp_daily -help`` to see which compilation options, packages, +and styles are included in the binary. Thanks to Anton Gladky (gladky.anton at gmail.com) for setting up this Ubuntu package capability. @@ -103,14 +113,14 @@ linking to the C library interface (lammps-devel, lammps-mpich-devel, lammps-openmpi-devel), the header for compiling programs using the C library interface (lammps-headers), and the LAMMPS python module for Python 3. All packages can be installed at the same -time and the name of the LAMMPS executable is *lmp* and *lmp_openmpi* -or *lmp_mpich* respectively. By default, *lmp* will refer to the +time and the name of the LAMMPS executable is ``lmp`` and ``lmp_openmpi`` +or ``lmp_mpich`` respectively. By default, ``lmp`` will refer to the serial executable, unless one of the MPI environment modules is loaded -("module load mpi/mpich-x86_64" or "module load mpi/openmpi-x86_64"). +(``module load mpi/mpich-x86_64`` or ``module load mpi/openmpi-x86_64``). Then the corresponding parallel LAMMPS executable can be used. The same mechanism applies when loading the LAMMPS python module. -To install LAMMPS with OpenMPI and run an input in.lj with 2 CPUs do: +To install LAMMPS with OpenMPI and run an input ``in.lj`` with 2 CPUs do: .. code-block:: bash @@ -118,10 +128,10 @@ To install LAMMPS with OpenMPI and run an input in.lj with 2 CPUs do: $ module load mpi/openmpi-x86_64 $ mpirun -np 2 lmp -in in.lj -The "dnf install" command is needed only once. In case of a new LAMMPS -stable release, "dnf update" will automatically update to the newer +The ``dnf install`` command is needed only once. In case of a new LAMMPS +stable release, ``dnf update`` will automatically update to the newer version as soon at the RPM files are built and uploaded to the download -mirrors. The "module load" command is needed once per (shell) session +mirrors. The ``module load`` command is needed once per (shell) session or shell terminal instance, unless it is automatically loaded from the shell profile. @@ -134,7 +144,7 @@ can install the `openkim-models` package $ dnf install openkim-models -Please use "lmp -help" to see which compilation options, packages, +Please use ``lmp -help`` to see which compilation options, packages, and styles are included in the binary. Thanks to Christoph Junghans (LANL) for making LAMMPS available in Fedora. @@ -153,10 +163,10 @@ in the `Extra Packages for Enterprise Linux (EPEL) repository ` which diff --git a/doc/src/compute_orientorder_atom.rst b/doc/src/compute_orientorder_atom.rst index a967a6006c..34b12cb745 100644 --- a/doc/src/compute_orientorder_atom.rst +++ b/doc/src/compute_orientorder_atom.rst @@ -4,7 +4,7 @@ compute orientorder/atom command ================================ compute orientorder/atom/kk command -======================= +=================================== Syntax """""" diff --git a/doc/src/fix_bond_react.rst b/doc/src/fix_bond_react.rst old mode 100644 new mode 100755 index 8daa52a73d..fc260de324 --- a/doc/src/fix_bond_react.rst +++ b/doc/src/fix_bond_react.rst @@ -158,7 +158,9 @@ The following comments pertain to each *react* argument (in other words, can be customized for each reaction, or reaction step): A check for possible new reaction sites is performed every *Nevery* -timesteps. +timesteps. *Nevery* can be specified with an equal-style +:doc:`variable `, whose value is rounded up to the nearest +integer. Three physical conditions must be met for a reaction to occur. First, a bonding atom pair must be identified within the reaction distance @@ -171,19 +173,29 @@ modified to match the post-reaction template. A bonding atom pair will be identified if several conditions are met. First, a pair of atoms I,J within the specified react-group-ID of type itype and jtype must be separated by a distance between *Rmin* and -*Rmax*\ . It is possible that multiple bonding atom pairs are -identified: if the bonding atoms in the pre-reacted template are 1-2 -neighbors, i.e. directly bonded, the farthest bonding atom partner is -set as its bonding partner; otherwise, the closest potential partner -is chosen. Then, if both an atom I and atom J have each other as their -bonding partners, these two atoms are identified as the bonding atom -pair of the reaction site. Once this unique bonding atom pair is -identified for each reaction, there could two or more reactions that -involve a given atom on the same timestep. If this is the case, only -one such reaction is permitted to occur. This reaction is chosen -randomly from all potential reactions. This capability allows e.g. for -different reaction pathways to proceed from identical reaction sites -with user-specified probabilities. +*Rmax*\ . *Rmin* and *Rmax* can be specified with equal-style +:doc:`variables `. For example, these reaction cutoffs can +be a function of the reaction conversion using the following commands: + +.. code-block:: LAMMPS + + variable rmax equal 0 # initialize variable before bond/react + fix myrxn all bond/react react myrxn1 all 1 0 v_rmax mol1 mol2 map_file.txt + variable rmax equal 3+f_myrxn[1]/100 # arbitrary function of reaction count + +It is possible that multiple bonding atom pairs are identified: if the +bonding atoms in the pre-reacted template are 1-2 neighbors, i.e. +directly bonded, the farthest bonding atom partner is set as its +bonding partner; otherwise, the closest potential partner is chosen. +Then, if both an atom I and atom J have each other as their bonding +partners, these two atoms are identified as the bonding atom pair of +the reaction site. Once this unique bonding atom pair is identified +for each reaction, there could two or more reactions that involve a +given atom on the same timestep. If this is the case, only one such +reaction is permitted to occur. This reaction is chosen randomly from +all potential reactions. This capability allows e.g. for different +reaction pathways to proceed from identical reaction sites with +user-specified probabilities. The pre-reacted molecule template is specified by a molecule command. This molecule template file contains a sample reaction site and its @@ -419,7 +431,8 @@ it occurs: The *prob* keyword can affect whether or not an eligible reaction actually occurs. The fraction setting must be a value between 0.0 and -1.0. A uniform random number between 0.0 and 1.0 is generated and the +1.0, and can be specified with an equal-style :doc:`variable `. +A uniform random number between 0.0 and 1.0 is generated and the eligible reaction only occurs if the random number is less than the fraction. Up to N reactions are permitted to occur, as optionally specified by the *max_rxn* keyword. @@ -489,10 +502,11 @@ local command. **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). Additionally, internally-created per-atom -properties are stored to allow for smooth restarts. None of the -:doc:`fix_modify ` options are relevant to this fix. +Cumulative reaction counts for each reaction are written to :doc:`binary restart files `. +These values are associated with the reaction name (react-ID). +Additionally, internally-created per-atom properties are stored to +allow for smooth restarts. None of the :doc:`fix_modify ` +options are relevant to this fix. This fix computes one statistic for each *react* argument that it stores in a global vector, of length 'number of react arguments', that diff --git a/examples/USER/reaction/nylon,6-6_melt/large_nylon_melt.data.gz b/examples/USER/reaction/nylon,6-6_melt/large_nylon_melt.data.gz new file mode 100644 index 0000000000..c620b879a8 Binary files /dev/null and b/examples/USER/reaction/nylon,6-6_melt/large_nylon_melt.data.gz differ diff --git a/examples/USER/reaction/tiny_nylon/in.tiny_nylon.stabilized_variable_probability b/examples/USER/reaction/tiny_nylon/in.tiny_nylon.stabilized_variable_probability new file mode 100644 index 0000000000..2c101ac77c --- /dev/null +++ b/examples/USER/reaction/tiny_nylon/in.tiny_nylon.stabilized_variable_probability @@ -0,0 +1,56 @@ +# two monomer nylon example +# reaction produces a condensed water molecule + +units real + +boundary p p p + +atom_style full + +kspace_style pppm 1.0e-4 + +pair_style lj/class2/coul/long 8.5 + +angle_style class2 + +bond_style class2 + +dihedral_style class2 + +improper_style class2 + +read_data tiny_nylon.data + +variable runsteps equal 1000 +variable prob1 equal step/v_runsteps*2 +variable prob2 equal (step/v_runsteps)>0.5 + +velocity all create 300.0 4928459 dist gaussian + +molecule mol1 rxn1_stp1_unreacted.data_template +molecule mol2 rxn1_stp1_reacted.data_template +molecule mol3 rxn1_stp2_unreacted.data_template +molecule mol4 rxn1_stp2_reacted.data_template + +thermo 50 + +# dump 1 all xyz 1 test_vis.xyz + +fix myrxns all bond/react stabilization yes statted_grp .03 & + react rxn1 all 1 0.0 5.0 mol1 mol2 rxn1_stp1_map prob v_prob1 1234 & + react rxn2 all 1 0.0 5.0 mol3 mol4 rxn1_stp2_map prob v_prob2 1234 + +fix 1 statted_grp_REACT nvt temp 300 300 100 + +# optionally, you can customize behavior of reacting atoms, +# by using the internally-created 'bond_react_MASTER_group', like so: +fix 4 bond_react_MASTER_group temp/rescale 1 300 300 10 1 + +thermo_style custom step temp press density v_prob1 v_prob2 f_myrxns[1] f_myrxns[2] + +# restart 100 restart1 restart2 + +run ${runsteps} + +# write_restart restart_longrun +# write_data restart_longrun.data diff --git a/examples/USER/reaction/tiny_nylon/log.22Apr20.tiny_nylon.stabilized_variable_probability.g++.1 b/examples/USER/reaction/tiny_nylon/log.22Apr20.tiny_nylon.stabilized_variable_probability.g++.1 new file mode 100644 index 0000000000..16e4deef51 --- /dev/null +++ b/examples/USER/reaction/tiny_nylon/log.22Apr20.tiny_nylon.stabilized_variable_probability.g++.1 @@ -0,0 +1,201 @@ +LAMMPS (15 Apr 2020) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) + using 1 OpenMP thread(s) per MPI task +# two monomer nylon example +# reaction produces a condensed water molecule + +units real + +boundary p p p + +atom_style full + +kspace_style pppm 1.0e-4 + +pair_style lj/class2/coul/long 8.5 + +angle_style class2 + +bond_style class2 + +dihedral_style class2 + +improper_style class2 + +read_data tiny_nylon.data + orthogonal box = (-25 -25 -25) to (25 25 25) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 44 atoms + reading velocities ... + 44 velocities + scanning bonds ... + 9 = max bonds/atom + scanning angles ... + 21 = max angles/atom + scanning dihedrals ... + 29 = max dihedrals/atom + scanning impropers ... + 29 = max impropers/atom + reading bonds ... + 42 bonds + reading angles ... + 74 angles + reading dihedrals ... + 100 dihedrals + reading impropers ... + 44 impropers + 4 = max # of 1-2 neighbors + 6 = max # of 1-3 neighbors + 12 = max # of 1-4 neighbors + 41 = max # of special neighbors + special bonds CPU = 0.000385045 secs + read_data CPU = 0.013443 secs + +variable runsteps equal 1000 +variable prob1 equal step/v_runsteps*2 +variable prob2 equal (step/v_runsteps)>0.5 + +velocity all create 300.0 4928459 dist gaussian + +molecule mol1 rxn1_stp1_unreacted.data_template +Read molecule template mol1: + 1 molecules + 18 atoms with max type 8 + 16 bonds with max type 14 + 25 angles with max type 28 + 23 dihedrals with max type 36 + 14 impropers with max type 11 +molecule mol2 rxn1_stp1_reacted.data_template +Read molecule template mol2: + 1 molecules + 18 atoms with max type 9 + 17 bonds with max type 13 + 31 angles with max type 27 + 39 dihedrals with max type 33 + 20 impropers with max type 1 +molecule mol3 rxn1_stp2_unreacted.data_template +Read molecule template mol3: + 1 molecules + 15 atoms with max type 9 + 14 bonds with max type 13 + 25 angles with max type 27 + 30 dihedrals with max type 33 + 16 impropers with max type 1 +molecule mol4 rxn1_stp2_reacted.data_template +Read molecule template mol4: + 1 molecules + 15 atoms with max type 11 + 13 bonds with max type 15 + 19 angles with max type 29 + 16 dihedrals with max type 32 + 10 impropers with max type 13 + +thermo 50 + +# dump 1 all xyz 1 test_vis.xyz + +fix myrxns all bond/react stabilization yes statted_grp .03 react rxn1 all 1 0.0 5.0 mol1 mol2 rxn1_stp1_map prob v_prob1 1234 react rxn2 all 1 0.0 5.0 mol3 mol4 rxn1_stp2_map prob v_prob2 1234 +WARNING: Bond/react: Atom affected by reaction rxn1 too close to template edge (src/USER-REACTION/fix_bond_react.cpp:2051) +WARNING: Bond/react: Atom affected by reaction rxn2 too close to template edge (src/USER-REACTION/fix_bond_react.cpp:2051) +dynamic group bond_react_MASTER_group defined +dynamic group statted_grp_REACT defined + +fix 1 statted_grp_REACT nvt temp 300 300 100 + +# optionally, you can customize behavior of reacting atoms, +# by using the internally-created 'bond_react_MASTER_group', like so: +fix 4 bond_react_MASTER_group temp/rescale 1 300 300 10 1 + +thermo_style custom step temp press density v_prob1 v_prob2 f_myrxns[1] f_myrxns[2] + +# restart 100 restart1 restart2 + +run ${runsteps} +run 1000 +PPPM initialization ... + using 12-bit tables for long-range coulomb (src/kspace.cpp:332) + G vector (1/distance) = 0.0534597 + grid = 2 2 2 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0402256 + estimated relative force accuracy = 0.000121138 + using double precision FFTW3 + 3d grid and FFT values/proc = 343 8 +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 10.5 + ghost atom cutoff = 10.5 + binsize = 5.25, bins = 10 10 10 + 2 neighbor lists, perpetual/occasional/extra = 1 1 0 + (1) pair lj/class2/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d/newton + bin: standard + (2) fix bond/react, occasional, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +WARNING: Inconsistent image flags (src/domain.cpp:812) +Per MPI rank memory allocation (min/avg/max) = 33.78 | 33.78 | 33.78 Mbytes +Step Temp Press Density v_prob1 v_prob2 f_myrxns[1] f_myrxns[2] + 0 300 346.78165 0.0034851739 0 0 0 0 + 50 262.63913 -492.10749 0.0034851739 0.1 0 1 0 + 100 766.52962 -29.714349 0.0034851739 0.2 0 1 0 + 150 503.86837 50.220304 0.0034851739 0.3 0 1 0 + 200 456.51295 12.312892 0.0034851739 0.4 0 1 0 + 250 391.54928 9.2335844 0.0034851739 0.5 0 1 0 + 300 336.6988 -47.193937 0.0034851739 0.6 0 1 0 + 350 254.06985 -9.2867898 0.0034851739 0.7 0 1 0 + 400 259.41098 -25.657321 0.0034851739 0.8 0 1 0 + 450 258.10364 22.5086 0.0034851739 0.9 0 1 0 + 500 272.13412 -6.5391448 0.0034851739 1 0 1 0 + 550 202.75504 54.658731 0.0034851739 1.1 1 1 1 + 600 344.79887 23.798478 0.0034851739 1.2 1 1 1 + 650 328.44488 -29.908484 0.0034851739 1.3 1 1 1 + 700 280.13593 -8.3223255 0.0034851739 1.4 1 1 1 + 750 300.67624 1.0632669 0.0034851739 1.5 1 1 1 + 800 376.64234 12.488392 0.0034851739 1.6 1 1 1 + 850 321.07642 19.814074 0.0034851739 1.7 1 1 1 + 900 332.23751 30.814079 0.0034851739 1.8 1 1 1 + 950 311.14029 5.7853136 0.0034851739 1.9 1 1 1 + 1000 253.14634 -37.560642 0.0034851739 2 1 1 1 +Loop time of 0.379454 on 1 procs for 1000 steps with 44 atoms + +Performance: 227.696 ns/day, 0.105 hours/ns, 2635.368 timesteps/s +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.069723 | 0.069723 | 0.069723 | 0.0 | 18.37 +Bond | 0.14802 | 0.14802 | 0.14802 | 0.0 | 39.01 +Kspace | 0.044252 | 0.044252 | 0.044252 | 0.0 | 11.66 +Neigh | 0.072359 | 0.072359 | 0.072359 | 0.0 | 19.07 +Comm | 0.0044748 | 0.0044748 | 0.0044748 | 0.0 | 1.18 +Output | 0.0022775 | 0.0022775 | 0.0022775 | 0.0 | 0.60 +Modify | 0.036509 | 0.036509 | 0.036509 | 0.0 | 9.62 +Other | | 0.00184 | | | 0.48 + +Nlocal: 44 ave 44 max 44 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 3 ave 3 max 3 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 722 ave 722 max 722 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 722 +Ave neighs/atom = 16.4091 +Ave special neighs/atom = 9.77273 +Neighbor list builds = 1000 +Dangerous builds = 0 + +# write_restart restart_longrun +# write_data restart_longrun.data + +Please see the log.cite file for references relevant to this simulation + +Total wall time: 0:00:00 diff --git a/examples/USER/reaction/tiny_nylon/log.22Apr20.tiny_nylon.stabilized_variable_probability.g++.4 b/examples/USER/reaction/tiny_nylon/log.22Apr20.tiny_nylon.stabilized_variable_probability.g++.4 new file mode 100644 index 0000000000..527d71ce87 --- /dev/null +++ b/examples/USER/reaction/tiny_nylon/log.22Apr20.tiny_nylon.stabilized_variable_probability.g++.4 @@ -0,0 +1,201 @@ +LAMMPS (15 Apr 2020) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) + using 1 OpenMP thread(s) per MPI task +# two monomer nylon example +# reaction produces a condensed water molecule + +units real + +boundary p p p + +atom_style full + +kspace_style pppm 1.0e-4 + +pair_style lj/class2/coul/long 8.5 + +angle_style class2 + +bond_style class2 + +dihedral_style class2 + +improper_style class2 + +read_data tiny_nylon.data + orthogonal box = (-25 -25 -25) to (25 25 25) + 1 by 2 by 2 MPI processor grid + reading atoms ... + 44 atoms + reading velocities ... + 44 velocities + scanning bonds ... + 9 = max bonds/atom + scanning angles ... + 21 = max angles/atom + scanning dihedrals ... + 29 = max dihedrals/atom + scanning impropers ... + 29 = max impropers/atom + reading bonds ... + 42 bonds + reading angles ... + 74 angles + reading dihedrals ... + 100 dihedrals + reading impropers ... + 44 impropers + 4 = max # of 1-2 neighbors + 6 = max # of 1-3 neighbors + 12 = max # of 1-4 neighbors + 41 = max # of special neighbors + special bonds CPU = 0.000431282 secs + read_data CPU = 0.0129571 secs + +variable runsteps equal 1000 +variable prob1 equal step/v_runsteps*2 +variable prob2 equal (step/v_runsteps)>0.5 + +velocity all create 300.0 4928459 dist gaussian + +molecule mol1 rxn1_stp1_unreacted.data_template +Read molecule template mol1: + 1 molecules + 18 atoms with max type 8 + 16 bonds with max type 14 + 25 angles with max type 28 + 23 dihedrals with max type 36 + 14 impropers with max type 11 +molecule mol2 rxn1_stp1_reacted.data_template +Read molecule template mol2: + 1 molecules + 18 atoms with max type 9 + 17 bonds with max type 13 + 31 angles with max type 27 + 39 dihedrals with max type 33 + 20 impropers with max type 1 +molecule mol3 rxn1_stp2_unreacted.data_template +Read molecule template mol3: + 1 molecules + 15 atoms with max type 9 + 14 bonds with max type 13 + 25 angles with max type 27 + 30 dihedrals with max type 33 + 16 impropers with max type 1 +molecule mol4 rxn1_stp2_reacted.data_template +Read molecule template mol4: + 1 molecules + 15 atoms with max type 11 + 13 bonds with max type 15 + 19 angles with max type 29 + 16 dihedrals with max type 32 + 10 impropers with max type 13 + +thermo 50 + +# dump 1 all xyz 1 test_vis.xyz + +fix myrxns all bond/react stabilization yes statted_grp .03 react rxn1 all 1 0.0 5.0 mol1 mol2 rxn1_stp1_map prob v_prob1 1234 react rxn2 all 1 0.0 5.0 mol3 mol4 rxn1_stp2_map prob v_prob2 1234 +WARNING: Bond/react: Atom affected by reaction rxn1 too close to template edge (src/USER-REACTION/fix_bond_react.cpp:2051) +WARNING: Bond/react: Atom affected by reaction rxn2 too close to template edge (src/USER-REACTION/fix_bond_react.cpp:2051) +dynamic group bond_react_MASTER_group defined +dynamic group statted_grp_REACT defined + +fix 1 statted_grp_REACT nvt temp 300 300 100 + +# optionally, you can customize behavior of reacting atoms, +# by using the internally-created 'bond_react_MASTER_group', like so: +fix 4 bond_react_MASTER_group temp/rescale 1 300 300 10 1 + +thermo_style custom step temp press density v_prob1 v_prob2 f_myrxns[1] f_myrxns[2] + +# restart 100 restart1 restart2 + +run ${runsteps} +run 1000 +PPPM initialization ... + using 12-bit tables for long-range coulomb (src/kspace.cpp:332) + G vector (1/distance) = 0.0534597 + grid = 2 2 2 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0402256 + estimated relative force accuracy = 0.000121138 + using double precision FFTW3 + 3d grid and FFT values/proc = 252 2 +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 10.5 + ghost atom cutoff = 10.5 + binsize = 5.25, bins = 10 10 10 + 2 neighbor lists, perpetual/occasional/extra = 1 1 0 + (1) pair lj/class2/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d/newton + bin: standard + (2) fix bond/react, occasional, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +WARNING: Inconsistent image flags (src/domain.cpp:812) +Per MPI rank memory allocation (min/avg/max) = 33.66 | 33.88 | 34.43 Mbytes +Step Temp Press Density v_prob1 v_prob2 f_myrxns[1] f_myrxns[2] + 0 300 346.78165 0.0034851739 0 0 0 0 + 50 266.5092 -90.813802 0.0034851739 0.1 0 1 0 + 100 559.41271 -53.23688 0.0034851739 0.2 0 1 0 + 150 489.90516 31.555817 0.0034851739 0.3 0 1 0 + 200 326.18391 7.7889992 0.0034851739 0.4 0 1 0 + 250 339.78203 2.3919541 0.0034851739 0.5 0 1 0 + 300 370.90263 -32.01673 0.0034851739 0.6 0 1 0 + 350 294.07547 -5.4019813 0.0034851739 0.7 0 1 0 + 400 287.76477 12.254133 0.0034851739 0.8 0 1 0 + 450 293.36482 66.372956 0.0034851739 0.9 0 1 0 + 500 246.84496 26.132317 0.0034851739 1 0 1 0 + 550 253.08778 -15.350262 0.0034851739 1.1 1 1 1 + 600 358.83641 25.007371 0.0034851739 1.2 1 1 1 + 650 320.51492 -32.34823 0.0034851739 1.3 1 1 1 + 700 310.87976 -8.2306669 0.0034851739 1.4 1 1 1 + 750 307.54142 12.025818 0.0034851739 1.5 1 1 1 + 800 272.51724 -22.92823 0.0034851739 1.6 1 1 1 + 850 268.66181 10.069534 0.0034851739 1.7 1 1 1 + 900 265.5531 -10.471377 0.0034851739 1.8 1 1 1 + 950 259.43086 9.4546712 0.0034851739 1.9 1 1 1 + 1000 247.14622 20.250308 0.0034851739 2 1 1 1 +Loop time of 0.357762 on 4 procs for 1000 steps with 44 atoms + +Performance: 241.502 ns/day, 0.099 hours/ns, 2795.157 timesteps/s +99.0% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0003917 | 0.015545 | 0.033317 | 11.9 | 4.35 +Bond | 0.0010131 | 0.030153 | 0.076975 | 18.2 | 8.43 +Kspace | 0.092857 | 0.1462 | 0.18688 | 10.7 | 40.87 +Neigh | 0.043786 | 0.044014 | 0.044189 | 0.1 | 12.30 +Comm | 0.03636 | 0.038345 | 0.040538 | 0.8 | 10.72 +Output | 0.00091578 | 0.0012541 | 0.0020923 | 1.4 | 0.35 +Modify | 0.075379 | 0.080791 | 0.086052 | 1.8 | 22.58 +Other | | 0.00146 | | | 0.41 + +Nlocal: 11 ave 32 max 0 min +Histogram: 2 0 1 0 0 0 0 0 0 1 +Nghost: 40 ave 51 max 19 min +Histogram: 1 0 0 0 0 0 0 1 0 2 +Neighs: 191 ave 529 max 0 min +Histogram: 2 0 0 0 1 0 0 0 0 1 + +Total # of neighbors = 764 +Ave neighs/atom = 17.3636 +Ave special neighs/atom = 9.77273 +Neighbor list builds = 1000 +Dangerous builds = 0 + +# write_restart restart_longrun +# write_data restart_longrun.data + +Please see the log.cite file for references relevant to this simulation + +Total wall time: 0:00:00 diff --git a/lib/message/cslib/src/STUBS_ZMQ/zmq.h b/lib/message/cslib/src/STUBS_ZMQ/zmq.h index 2f02eb4035..a335ee5e01 100644 --- a/lib/message/cslib/src/STUBS_ZMQ/zmq.h +++ b/lib/message/cslib/src/STUBS_ZMQ/zmq.h @@ -17,6 +17,8 @@ #ifndef ZMQ_DUMMY_H #define ZMQ_DUMMY_H +#include + namespace CSLIB_NS { #define ZMQ_REQ 0 diff --git a/src/KOKKOS/angle_charmm_kokkos.cpp b/src/KOKKOS/angle_charmm_kokkos.cpp index 245aead73e..8d7a4d23d6 100644 --- a/src/KOKKOS/angle_charmm_kokkos.cpp +++ b/src/KOKKOS/angle_charmm_kokkos.cpp @@ -72,21 +72,21 @@ void AngleCharmmKokkos::compute(int eflag_in, int vflag_in) //if(k_eatom.extent(0)destroy_kokkos(k_eatom,eatom); memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); - d_eatom = k_eatom.template view(); + d_eatom = k_eatom.template view(); //} } if (vflag_atom) { //if(k_vatom.extent(0)destroy_kokkos(k_vatom,vatom); memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"improper:vatom"); - d_vatom = k_vatom.template view(); + d_vatom = k_vatom.template view(); //} } x = atomKK->k_x.view(); f = atomKK->k_f.view(); neighborKK->k_anglelist.template sync(); - anglelist = neighborKK->k_anglelist.view(); + anglelist = neighborKK->k_anglelist.view(); int nanglelist = neighborKK->nanglelist; nlocal = atom->nlocal; newton_bond = force->newton_bond; @@ -265,10 +265,10 @@ void AngleCharmmKokkos::coeff(int narg, char **arg) AngleCharmm::coeff(narg, arg); int n = atom->nangletypes; - Kokkos::DualView k_k("AngleCharmm::k",n+1); - Kokkos::DualView k_theta0("AngleCharmm::theta0",n+1); - Kokkos::DualView k_k_ub("AngleCharmm::k_ub",n+1); - Kokkos::DualView k_r_ub("AngleCharmm::r_ub",n+1); + typename AT::tdual_ffloat_1d k_k("AngleCharmm::k",n+1); + typename AT::tdual_ffloat_1d k_theta0("AngleCharmm::theta0",n+1); + typename AT::tdual_ffloat_1d k_k_ub("AngleCharmm::k_ub",n+1); + typename AT::tdual_ffloat_1d k_r_ub("AngleCharmm::r_ub",n+1); d_k = k_k.template view(); d_theta0 = k_theta0.template view(); @@ -303,10 +303,10 @@ void AngleCharmmKokkos::read_restart(FILE *fp) AngleCharmm::read_restart(fp); int n = atom->nangletypes; - Kokkos::DualView k_k("AngleCharmm::k",n+1); - Kokkos::DualView k_theta0("AngleCharmm::theta0",n+1); - Kokkos::DualView k_k_ub("AngleCharmm::k_ub",n+1); - Kokkos::DualView k_r_ub("AngleCharmm::r_ub",n+1); + typename AT::tdual_ffloat_1d k_k("AngleCharmm::k",n+1); + typename AT::tdual_ffloat_1d k_theta0("AngleCharmm::theta0",n+1); + typename AT::tdual_ffloat_1d k_k_ub("AngleCharmm::k_ub",n+1); + typename AT::tdual_ffloat_1d k_r_ub("AngleCharmm::r_ub",n+1); d_k = k_k.template view(); d_theta0 = k_theta0.template view(); diff --git a/src/KOKKOS/angle_charmm_kokkos.h b/src/KOKKOS/angle_charmm_kokkos.h index 865439b83a..c7f64d4c22 100644 --- a/src/KOKKOS/angle_charmm_kokkos.h +++ b/src/KOKKOS/angle_charmm_kokkos.h @@ -63,11 +63,13 @@ class AngleCharmmKokkos : public AngleCharmm { typedef ArrayTypes AT; typename AT::t_x_array_randomread x; - typename Kokkos::View::value,Kokkos::MemoryTraits > f; + + typedef typename KKDevice::value KKDeviceType; + typename Kokkos::View > f; typename AT::t_int_2d anglelist; - Kokkos::DualView k_eatom; - Kokkos::DualView k_vatom; + Kokkos::DualView k_eatom; + Kokkos::DualView k_vatom; Kokkos::View::value,Kokkos::MemoryTraits > d_eatom; Kokkos::View::value,Kokkos::MemoryTraits > d_vatom; diff --git a/src/KOKKOS/bond_harmonic_kokkos.cpp b/src/KOKKOS/bond_harmonic_kokkos.cpp index e0d75dcd9a..4e2a5aaa05 100644 --- a/src/KOKKOS/bond_harmonic_kokkos.cpp +++ b/src/KOKKOS/bond_harmonic_kokkos.cpp @@ -69,14 +69,14 @@ void BondHarmonicKokkos::compute(int eflag_in, int vflag_in) //if(k_eatom.extent(0)destroy_kokkos(k_eatom,eatom); memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); - d_eatom = k_eatom.template view(); + d_eatom = k_eatom.template view(); //} } if (vflag_atom) { //if(k_vatom.extent(0)destroy_kokkos(k_vatom,vatom); memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"improper:vatom"); - d_vatom = k_vatom.template view(); + d_vatom = k_vatom.template view(); //} } @@ -204,8 +204,8 @@ void BondHarmonicKokkos::coeff(int narg, char **arg) BondHarmonic::coeff(narg, arg); int n = atom->nbondtypes; - Kokkos::DualView k_k("BondHarmonic::k",n+1); - Kokkos::DualView k_r0("BondHarmonic::r0",n+1); + typename AT::tdual_ffloat_1d k_k("BondHarmonic::k",n+1); + typename AT::tdual_ffloat_1d k_r0("BondHarmonic::r0",n+1); d_k = k_k.template view(); d_r0 = k_r0.template view(); @@ -231,8 +231,8 @@ void BondHarmonicKokkos::read_restart(FILE *fp) BondHarmonic::read_restart(fp); int n = atom->nbondtypes; - Kokkos::DualView k_k("BondHarmonic::k",n+1); - Kokkos::DualView k_r0("BondHarmonic::r0",n+1); + typename AT::tdual_ffloat_1d k_k("BondHarmonic::k",n+1); + typename AT::tdual_ffloat_1d k_r0("BondHarmonic::r0",n+1); d_k = k_k.template view(); d_r0 = k_r0.template view(); diff --git a/src/KOKKOS/bond_harmonic_kokkos.h b/src/KOKKOS/bond_harmonic_kokkos.h index b5bee7e909..cf716ec843 100644 --- a/src/KOKKOS/bond_harmonic_kokkos.h +++ b/src/KOKKOS/bond_harmonic_kokkos.h @@ -66,10 +66,11 @@ class BondHarmonicKokkos : public BondHarmonic { typename Kokkos::View::value,Kokkos::MemoryTraits > f; typename AT::t_int_2d bondlist; - Kokkos::DualView k_eatom; - Kokkos::DualView k_vatom; - Kokkos::View::value,Kokkos::MemoryTraits > d_eatom; - Kokkos::View::value,Kokkos::MemoryTraits > d_vatom; + typedef typename KKDevice::value KKDeviceType; + Kokkos::DualView k_eatom; + Kokkos::DualView k_vatom; + Kokkos::View > d_eatom; + Kokkos::View > d_vatom; int nlocal,newton_bond; int eflag,vflag; diff --git a/src/KOKKOS/compute_orientorder_atom_kokkos.cpp b/src/KOKKOS/compute_orientorder_atom_kokkos.cpp index b9722f9e2a..d00dc3e238 100644 --- a/src/KOKKOS/compute_orientorder_atom_kokkos.cpp +++ b/src/KOKKOS/compute_orientorder_atom_kokkos.cpp @@ -161,7 +161,7 @@ void ComputeOrientOrderAtomKokkos::compute_peratom() d_distsq = t_sna_2d_lr("orientorder/atom:distsq",chunk_size,maxneigh); d_nearest = t_sna_2i_lr("orientorder/atom:nearest",chunk_size,maxneigh); d_rlist = t_sna_3d_lr("orientorder/atom:rlist",chunk_size,maxneigh,3); - + d_distsq_um = d_distsq; d_rlist_um = d_rlist; d_nearest_um = d_nearest; @@ -194,11 +194,11 @@ void ComputeOrientOrderAtomKokkos::compute_peratom() typename Kokkos::TeamPolicy policy_neigh(chunk_size,team_size,vector_length); Kokkos::parallel_for("ComputeOrientOrderAtomNeigh",policy_neigh,*this); } - + //Select3 typename Kokkos::RangePolicy policy_select3(0,chunk_size); Kokkos::parallel_for("ComputeOrientOrderAtomSelect3",policy_select3,*this); - + //BOOP1 { int vector_length = vector_length_default; @@ -207,7 +207,7 @@ void ComputeOrientOrderAtomKokkos::compute_peratom() typename Kokkos::TeamPolicy policy_boop1(((chunk_size+team_size-1)/team_size)*maxneigh,team_size,vector_length); Kokkos::parallel_for("ComputeOrientOrderAtomBOOP1",policy_boop1,*this); } - + //BOOP2 typename Kokkos::RangePolicy policy_boop2(0,chunk_size); Kokkos::parallel_for("ComputeOrientOrderAtomBOOP2",policy_boop2,*this); diff --git a/src/KOKKOS/dihedral_charmm_kokkos.cpp b/src/KOKKOS/dihedral_charmm_kokkos.cpp index 61495f4827..64ab79c305 100644 --- a/src/KOKKOS/dihedral_charmm_kokkos.cpp +++ b/src/KOKKOS/dihedral_charmm_kokkos.cpp @@ -86,18 +86,18 @@ void DihedralCharmmKokkos::compute(int eflag_in, int vflag_in) //if(k_eatom.extent(0)destroy_kokkos(k_eatom,eatom); memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"dihedral:eatom"); - d_eatom = k_eatom.template view(); - k_eatom_pair = Kokkos::DualView("dihedral:eatom_pair",maxeatom); - d_eatom_pair = k_eatom_pair.template view(); + d_eatom = k_eatom.template view(); + k_eatom_pair = Kokkos::DualView("dihedral:eatom_pair",maxeatom); + d_eatom_pair = k_eatom_pair.template view(); //} } if (vflag_atom) { //if(k_vatom.extent(0)destroy_kokkos(k_vatom,vatom); memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"dihedral:vatom"); - d_vatom = k_vatom.template view(); - k_vatom_pair = Kokkos::DualView("dihedral:vatom_pair",maxvatom); - d_vatom_pair = k_vatom_pair.template view(); + d_vatom = k_vatom.template view(); + k_vatom_pair = Kokkos::DualView("dihedral:vatom_pair",maxvatom); + d_vatom_pair = k_vatom_pair.template view(); //} } @@ -428,12 +428,12 @@ void DihedralCharmmKokkos::coeff(int narg, char **arg) DihedralCharmm::coeff(narg, arg); int nd = atom->ndihedraltypes; - Kokkos::DualView k_k("DihedralCharmm::k",nd+1); - Kokkos::DualView k_multiplicity("DihedralCharmm::multiplicity",nd+1); - Kokkos::DualView k_shift("DihedralCharmm::shift",nd+1); - Kokkos::DualView k_cos_shift("DihedralCharmm::cos_shift",nd+1); - Kokkos::DualView k_sin_shift("DihedralCharmm::sin_shift",nd+1); - Kokkos::DualView k_weight("DihedralCharmm::weight",nd+1); + typename AT::tdual_ffloat_1d k_k("DihedralCharmm::k",nd+1); + typename AT::tdual_ffloat_1d k_multiplicity("DihedralCharmm::multiplicity",nd+1); + typename AT::tdual_ffloat_1d k_shift("DihedralCharmm::shift",nd+1); + typename AT::tdual_ffloat_1d k_cos_shift("DihedralCharmm::cos_shift",nd+1); + typename AT::tdual_ffloat_1d k_sin_shift("DihedralCharmm::sin_shift",nd+1); + typename AT::tdual_ffloat_1d k_weight("DihedralCharmm::weight",nd+1); d_k = k_k.template view(); d_multiplicity = k_multiplicity.template view(); @@ -477,10 +477,10 @@ void DihedralCharmmKokkos::init_style() DihedralCharmm::init_style(); int n = atom->ntypes; - Kokkos::DualView k_lj14_1("DihedralCharmm:lj14_1",n+1,n+1); - Kokkos::DualView k_lj14_2("DihedralCharmm:lj14_2",n+1,n+1); - Kokkos::DualView k_lj14_3("DihedralCharmm:lj14_3",n+1,n+1); - Kokkos::DualView k_lj14_4("DihedralCharmm:lj14_4",n+1,n+1); + DAT::tdual_ffloat_2d k_lj14_1("DihedralCharmm:lj14_1",n+1,n+1); + DAT::tdual_ffloat_2d k_lj14_2("DihedralCharmm:lj14_2",n+1,n+1); + DAT::tdual_ffloat_2d k_lj14_3("DihedralCharmm:lj14_3",n+1,n+1); + DAT::tdual_ffloat_2d k_lj14_4("DihedralCharmm:lj14_4",n+1,n+1); d_lj14_1 = k_lj14_1.template view(); d_lj14_2 = k_lj14_2.template view(); @@ -521,12 +521,12 @@ void DihedralCharmmKokkos::read_restart(FILE *fp) DihedralCharmm::read_restart(fp); int nd = atom->ndihedraltypes; - Kokkos::DualView k_k("DihedralCharmm::k",nd+1); - Kokkos::DualView k_multiplicity("DihedralCharmm::multiplicity",nd+1); - Kokkos::DualView k_shift("DihedralCharmm::shift",nd+1); - Kokkos::DualView k_cos_shift("DihedralCharmm::cos_shift",nd+1); - Kokkos::DualView k_sin_shift("DihedralCharmm::sin_shift",nd+1); - Kokkos::DualView k_weight("DihedralCharmm::weight",nd+1); + typename AT::tdual_ffloat_1d k_k("DihedralCharmm::k",nd+1); + typename AT::tdual_ffloat_1d k_multiplicity("DihedralCharmm::multiplicity",nd+1); + typename AT::tdual_ffloat_1d k_shift("DihedralCharmm::shift",nd+1); + typename AT::tdual_ffloat_1d k_cos_shift("DihedralCharmm::cos_shift",nd+1); + typename AT::tdual_ffloat_1d k_sin_shift("DihedralCharmm::sin_shift",nd+1); + typename AT::tdual_ffloat_1d k_weight("DihedralCharmm::weight",nd+1); d_k = k_k.template view(); d_multiplicity = k_multiplicity.template view(); diff --git a/src/KOKKOS/dihedral_charmm_kokkos.h b/src/KOKKOS/dihedral_charmm_kokkos.h index 21bb6fd2e1..828abd2be7 100644 --- a/src/KOKKOS/dihedral_charmm_kokkos.h +++ b/src/KOKKOS/dihedral_charmm_kokkos.h @@ -132,15 +132,16 @@ class DihedralCharmmKokkos : public DihedralCharmm { typename AT::t_f_array f; typename AT::t_int_2d dihedrallist; - Kokkos::DualView k_eatom; - Kokkos::DualView k_vatom; - Kokkos::View::value,Kokkos::MemoryTraits > d_eatom; - Kokkos::View::value,Kokkos::MemoryTraits > d_vatom; + typedef typename KKDevice::value KKDeviceType; + Kokkos::DualView k_eatom; + Kokkos::DualView k_vatom; + Kokkos::View > d_eatom; + Kokkos::View > d_vatom; - Kokkos::DualView k_eatom_pair; - Kokkos::DualView k_vatom_pair; - Kokkos::View::value,Kokkos::MemoryTraits > d_eatom_pair; - Kokkos::View::value,Kokkos::MemoryTraits > d_vatom_pair; + Kokkos::DualView k_eatom_pair; + Kokkos::DualView k_vatom_pair; + Kokkos::View > d_eatom_pair; + Kokkos::View > d_vatom_pair; int nlocal,newton_bond; int eflag,vflag; diff --git a/src/KOKKOS/improper_harmonic_kokkos.cpp b/src/KOKKOS/improper_harmonic_kokkos.cpp index 6a32e8af47..6f2969722a 100644 --- a/src/KOKKOS/improper_harmonic_kokkos.cpp +++ b/src/KOKKOS/improper_harmonic_kokkos.cpp @@ -73,14 +73,14 @@ void ImproperHarmonicKokkos::compute(int eflag_in, int vflag_in) //if(k_eatom.extent(0)destroy_kokkos(k_eatom,eatom); memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); - d_eatom = k_eatom.template view(); + d_eatom = k_eatom.template view(); //} } if (vflag_atom) { //if(k_vatom.extent(0)destroy_kokkos(k_vatom,vatom); memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"improper:vatom"); - d_vatom = k_vatom.template view(); + d_vatom = k_vatom.template view(); //} } diff --git a/src/KOKKOS/improper_harmonic_kokkos.h b/src/KOKKOS/improper_harmonic_kokkos.h index fb44081928..e143e65adf 100644 --- a/src/KOKKOS/improper_harmonic_kokkos.h +++ b/src/KOKKOS/improper_harmonic_kokkos.h @@ -63,14 +63,15 @@ class ImproperHarmonicKokkos : public ImproperHarmonic { class NeighborKokkos *neighborKK; + typedef typename KKDevice::value KKDeviceType; typename AT::t_x_array_randomread x; - typename Kokkos::View::value,Kokkos::MemoryTraits > f; + typename Kokkos::View > f; typename AT::t_int_2d improperlist; - Kokkos::DualView k_eatom; - Kokkos::DualView k_vatom; - Kokkos::View::value,Kokkos::MemoryTraits > d_eatom; - Kokkos::View::value,Kokkos::MemoryTraits > d_vatom; + Kokkos::DualView k_eatom; + Kokkos::DualView k_vatom; + Kokkos::View > d_eatom; + Kokkos::View > d_vatom; int nlocal,newton_bond; int eflag,vflag; diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index 8f60f3526d..f54df5cb76 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -306,7 +306,7 @@ void KokkosLMP::accelerator(int narg, char **arg) neighflag = HALFTHREAD; else neighflag = HALF; - } else if (strcmp(arg[iarg+1],"n2") == 0) neighflag = N2; + } else error->all(FLERR,"Illegal package kokkos command"); if (!neighflag_qeq_set) neighflag_qeq = neighflag; iarg += 2; @@ -318,7 +318,7 @@ void KokkosLMP::accelerator(int narg, char **arg) neighflag_qeq = HALFTHREAD; else neighflag_qeq = HALF; - } else if (strcmp(arg[iarg+1],"n2") == 0) neighflag_qeq = N2; + } else error->all(FLERR,"Illegal package kokkos command"); neighflag_qeq_set = 1; iarg += 2; diff --git a/src/KOKKOS/kokkos_type.h b/src/KOKKOS/kokkos_type.h index c8fccaf409..796f4612a4 100644 --- a/src/KOKKOS/kokkos_type.h +++ b/src/KOKKOS/kokkos_type.h @@ -22,7 +22,7 @@ #include #include -enum{FULL=1u,HALFTHREAD=2u,HALF=4u,N2=8u}; +enum{FULL=1u,HALFTHREAD=2u,HALF=4u}; #if defined(KOKKOS_ENABLE_CXX11) #undef ISFINITE diff --git a/src/KOKKOS/neigh_list_kokkos.cpp b/src/KOKKOS/neigh_list_kokkos.cpp index 2b9c5ef645..afaf0dd1b8 100644 --- a/src/KOKKOS/neigh_list_kokkos.cpp +++ b/src/KOKKOS/neigh_list_kokkos.cpp @@ -19,20 +19,20 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -template -NeighListKokkos::NeighListKokkos(class LAMMPS *lmp):NeighList(lmp) +template +NeighListKokkos::NeighListKokkos(class LAMMPS *lmp):NeighList(lmp) { _stride = 1; maxneighs = 16; kokkos = 1; maxatoms = 0; - execution_space = ExecutionSpaceFromDevice::space; + execution_space = ExecutionSpaceFromDevice::space; }; /* ---------------------------------------------------------------------- */ -template -void NeighListKokkos::grow(int nmax) +template +void NeighListKokkos::grow(int nmax) { // skip if this list is already long enough to store nmax atoms // and maxneighs neighbors @@ -40,14 +40,12 @@ void NeighListKokkos::grow(int nmax) if (nmax <= maxatoms && d_neighbors.extent(1) >= maxneighs) return; maxatoms = nmax; - k_ilist = - DAT::tdual_int_1d("neighlist:ilist",maxatoms); - d_ilist = k_ilist.view(); - d_numneigh = - typename ArrayTypes::t_int_1d("neighlist:numneigh",maxatoms); - d_neighbors = - typename ArrayTypes::t_neighbors_2d("neighlist:neighbors", - maxatoms,maxneighs); + 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(); } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/neigh_list_kokkos.h b/src/KOKKOS/neigh_list_kokkos.h index 585422c54f..f8195a01f4 100644 --- a/src/KOKKOS/neigh_list_kokkos.h +++ b/src/KOKKOS/neigh_list_kokkos.h @@ -59,7 +59,7 @@ class AtomNeighborsConst const int _stride; }; -template +template class NeighListKokkos: public NeighList { int _stride; @@ -67,10 +67,12 @@ public: int maxneighs; void grow(int nmax); - typename ArrayTypes::t_neighbors_2d d_neighbors; - typename DAT::tdual_int_1d k_ilist; // local indices of I atoms - typename ArrayTypes::t_int_1d d_ilist; - typename ArrayTypes::t_int_1d d_numneigh; // # of J neighs for each I + 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); @@ -82,8 +84,8 @@ public: KOKKOS_INLINE_FUNCTION static AtomNeighborsConst static_neighbors_const(int i, - typename ArrayTypes::t_neighbors_2d_const const& d_neighbors, - typename ArrayTypes::t_int_1d_const const& d_numneigh) { + typename ArrayTypes::t_neighbors_2d_const const& d_neighbors, + typename ArrayTypes::t_int_1d_const const& d_numneigh) { return AtomNeighborsConst(&d_neighbors(i,0),d_numneigh(i), &d_neighbors(i,1)-&d_neighbors(i,0)); } diff --git a/src/KOKKOS/npair_copy_kokkos.cpp b/src/KOKKOS/npair_copy_kokkos.cpp index 0ce0f4d3ff..016d68400f 100644 --- a/src/KOKKOS/npair_copy_kokkos.cpp +++ b/src/KOKKOS/npair_copy_kokkos.cpp @@ -13,6 +13,8 @@ #include "npair_copy_kokkos.h" #include "neigh_list_kokkos.h" +#include "my_page.h" +#include "error.h" using namespace LAMMPS_NS; @@ -30,6 +32,24 @@ void NPairCopyKokkos::build(NeighList *list) { NeighList *listcopy = list->listcopy; + if (list->kokkos) { + if (!listcopy->kokkos) + error->all(FLERR,"Cannot copy non-Kokkos neighbor list to Kokkos neighbor list"); + copy_to_kokkos(list); + } else { + if (!listcopy->kokkos) + error->all(FLERR,"Missing Kokkos neighbor list for copy"); + copy_to_cpu(list); + } +} + +/* ---------------------------------------------------------------------- */ + +template +void NPairCopyKokkos::copy_to_kokkos(NeighList *list) +{ + NeighList *listcopy = list->listcopy; + list->inum = listcopy->inum; list->gnum = listcopy->gnum; list->ilist = listcopy->ilist; @@ -44,6 +64,62 @@ void NPairCopyKokkos::build(NeighList *list) list_kk->d_neighbors = listcopy_kk->d_neighbors; } +/* ---------------------------------------------------------------------- */ + +template +void NPairCopyKokkos::copy_to_cpu(NeighList *list) +{ + NeighList *listcopy = list->listcopy; + 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; + + list->inum = inum; + list->gnum = gnum; + auto ilist = list->ilist; + auto numneigh = list->numneigh; + + // Kokkos neighbor data is stored differently than regular CPU, + // must copy element by element + + int *neighptr; + int **firstneigh = list->firstneigh; + MyPage *ipage = list->ipage; + ipage->reset(); + + for (int ii = 0; ii < inum_all; ii++) { + neighptr = ipage->vget(); + + const int i = h_ilist[ii]; + ilist[ii] = i; + + // loop over Kokkos neighbor list + + const int jnum = h_numneigh[i]; + numneigh[i] = jnum; + + for (int jj = 0; jj < jnum; jj++) { + const int joriginal = h_neighbors(i,jj); + neighptr[jj] = joriginal; + } + + firstneigh[i] = neighptr; + ipage->vgot(jnum); + if (ipage->status()) + error->one(FLERR,"Neighbor list overflow, boost neigh_modify one"); + } +} + namespace LAMMPS_NS { template class NPairCopyKokkos; #ifdef KOKKOS_ENABLE_CUDA diff --git a/src/KOKKOS/npair_copy_kokkos.h b/src/KOKKOS/npair_copy_kokkos.h index 84eb10b204..4bbb2749e5 100644 --- a/src/KOKKOS/npair_copy_kokkos.h +++ b/src/KOKKOS/npair_copy_kokkos.h @@ -36,6 +36,9 @@ class NPairCopyKokkos : public NPair { NPairCopyKokkos(class LAMMPS *); ~NPairCopyKokkos() {} void build(class NeighList *); + private: + void copy_to_kokkos(class NeighList *); + void copy_to_cpu(class NeighList *); }; } diff --git a/src/KOKKOS/npair_halffull_kokkos.cpp b/src/KOKKOS/npair_halffull_kokkos.cpp index cc8f663ef2..754a5ca010 100644 --- a/src/KOKKOS/npair_halffull_kokkos.cpp +++ b/src/KOKKOS/npair_halffull_kokkos.cpp @@ -68,12 +68,14 @@ void NPairHalffullKokkos::build(NeighList *list) copymode = 1; Kokkos::parallel_for(Kokkos::RangePolicy(0,inum_full),*this); + copymode = 0; list->inum = k_list_full->inum; list->gnum = k_list_full->gnum; - k_list->k_ilist.template modify(); - copymode = 0; + 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 5a5bd6eb20..87d0366353 100644 --- a/src/KOKKOS/npair_kokkos.cpp +++ b/src/KOKKOS/npair_kokkos.cpp @@ -97,7 +97,7 @@ void NPairKokkos::copy_stencil_info() NPair::copy_stencil_info(); nstencil = ns->nstencil; - if (neighbor->last_setup_bins == update->ntimestep) { + if (ns->last_stencil == update->ntimestep) { // copy stencil to device as it may have changed int maxstencil = ns->get_maxstencil(); @@ -301,7 +301,8 @@ void NPairKokkos::build(NeighList *list_) if(data.h_resize()) { list->maxneighs = data.h_new_maxneighs() * 1.2; - list->d_neighbors = typename ArrayTypes::t_neighbors_2d("neighbors", list->d_neighbors.extent(0), list->maxneighs); + list->k_neighbors = DAT::tdual_neighbors_2d("neighbors", list->d_neighbors.extent(0), list->maxneighs); + list->d_neighbors = list->k_neighbors.template view(); data.neigh_list.d_neighbors = list->d_neighbors; data.neigh_list.maxneighs = list->maxneighs; } @@ -316,6 +317,8 @@ void NPairKokkos::build(NeighList *list_) } list->k_ilist.template modify(); + list->k_numneigh.template modify(); + list->k_neighbors.template modify(); } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/npair_ssa_kokkos.cpp b/src/KOKKOS/npair_ssa_kokkos.cpp index f9708e5fe8..b6d03e1445 100644 --- a/src/KOKKOS/npair_ssa_kokkos.cpp +++ b/src/KOKKOS/npair_ssa_kokkos.cpp @@ -519,6 +519,8 @@ 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(); } diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp index b28bbebbeb..46c5ee82cb 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp @@ -307,9 +307,6 @@ void PairBuckCoulCutKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with buck/coul/cut/kk"); } diff --git a/src/KOKKOS/pair_buck_kokkos.cpp b/src/KOKKOS/pair_buck_kokkos.cpp index 990c9e94a6..04ebd6608b 100644 --- a/src/KOKKOS/pair_buck_kokkos.cpp +++ b/src/KOKKOS/pair_buck_kokkos.cpp @@ -229,9 +229,6 @@ void PairBuckKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with buck/kk"); } diff --git a/src/KOKKOS/pair_buck_kokkos.h b/src/KOKKOS/pair_buck_kokkos.h index 2691f10929..815b5b2dee 100644 --- a/src/KOKKOS/pair_buck_kokkos.h +++ b/src/KOKKOS/pair_buck_kokkos.h @@ -31,7 +31,7 @@ namespace LAMMPS_NS { template class PairBuckKokkos : public PairBuck { public: - enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2}; + enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes AT; @@ -98,15 +98,12 @@ class PairBuckKokkos : public PairBuck { friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class 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*); - friend EV_FLOAT pair_compute_neighlist(PairBuckKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute(PairBuckKokkos*,NeighListKokkos*); friend void pair_virial_fdotr_compute(PairBuckKokkos*); }; diff --git a/src/KOKKOS/pair_coul_debye_kokkos.cpp b/src/KOKKOS/pair_coul_debye_kokkos.cpp index b212bdc53a..a544a5fb8d 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_coul_debye_kokkos.cpp @@ -276,9 +276,6 @@ void PairCoulDebyeKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with coul/debye/kk"); } diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 54035c54eb..2c89f8a7f3 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -87,6 +87,8 @@ struct PairComputeFunctor { c(*c_ptr),list(*list_ptr) { // allocate duplicated memory f = c.f; + d_eatom = c.d_eatom; + d_vatom = c.d_vatom; dup_f = Kokkos::Experimental::create_scatter_view::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); @@ -690,148 +692,6 @@ struct PairComputeFunctor { } }; -template -struct PairComputeFunctor { - typedef typename PairStyle::device_type device_type ; - typedef EV_FLOAT value_type; - - PairStyle c; - NeighListKokkos list; - - PairComputeFunctor(PairStyle* c_ptr, - NeighListKokkos* list_ptr): - c(*c_ptr),list(*list_ptr) {}; - ~PairComputeFunctor() {c.cleanup_copy();list.copymode = 1;}; - - KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const { - return j >> SBBITS & 3; - } - - - void contribute() {} - - template - KOKKOS_FUNCTION - EV_FLOAT compute_item(const int& ii, - const NeighListKokkos &list, const NoCoulTag&) const { - (void) list; - EV_FLOAT ev; - const int i = ii;//list.d_ilist[ii]; - const X_FLOAT xtmp = c.x(i,0); - const X_FLOAT ytmp = c.x(i,1); - const X_FLOAT ztmp = c.x(i,2); - const int itype = c.type(i); - - //const AtomNeighborsConst neighbors_i = list.get_neighbors_const(i); - const int jnum = c.nall; - - F_FLOAT fxtmp = 0.0; - F_FLOAT fytmp = 0.0; - F_FLOAT fztmp = 0.0; - - for (int jj = 0; jj < jnum; jj++) { - int j = jj;//neighbors_i(jj); - if(i==j) continue; - const F_FLOAT factor_lj = c.special_lj[sbmask(j)]; - j &= NEIGHMASK; - const X_FLOAT delx = xtmp - c.x(j,0); - const X_FLOAT dely = ytmp - c.x(j,1); - const X_FLOAT delz = ztmp - c.x(j,2); - const int jtype = c.type(j); - const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; - - if(rsq < (STACKPARAMS?c.m_cutsq[itype][jtype]:c.d_cutsq(itype,jtype))) { - - const F_FLOAT fpair = factor_lj*c.template compute_fpair(rsq,i,j,itype,jtype); - fxtmp += delx*fpair; - fytmp += dely*fpair; - fztmp += delz*fpair; - - if (EVFLAG) { - F_FLOAT evdwl = 0.0; - if (c.eflag) { - evdwl = 0.5* - factor_lj * c.template compute_evdwl(rsq,i,j,itype,jtype); - ev.evdwl += evdwl; - } - - if (c.vflag_either || c.eflag_atom) ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); - } - } - } - - c.f(i,0) += fxtmp; - c.f(i,1) += fytmp; - c.f(i,2) += fztmp; - - return ev; - } - - KOKKOS_INLINE_FUNCTION - void ev_tally(EV_FLOAT &ev, const int &i, const int &j, - const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, - const F_FLOAT &dely, const F_FLOAT &delz) const - { - const int EFLAG = c.eflag; - const int VFLAG = c.vflag_either; - - if (EFLAG) { - if (c.eflag_atom) { - const E_FLOAT epairhalf = 0.5 * epair; - if (i < c.nlocal) c.d_eatom[i] += epairhalf; - if (j < c.nlocal) c.d_eatom[j] += epairhalf; - } - } - - if (VFLAG) { - const E_FLOAT v0 = delx*delx*fpair; - const E_FLOAT v1 = dely*dely*fpair; - const E_FLOAT v2 = delz*delz*fpair; - const E_FLOAT v3 = delx*dely*fpair; - const E_FLOAT v4 = delx*delz*fpair; - const E_FLOAT v5 = dely*delz*fpair; - - if (c.vflag_global) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } - - if (c.vflag_atom) { - if (i < c.nlocal) { - c.d_vatom(i,0) += 0.5*v0; - c.d_vatom(i,1) += 0.5*v1; - c.d_vatom(i,2) += 0.5*v2; - c.d_vatom(i,3) += 0.5*v3; - c.d_vatom(i,4) += 0.5*v4; - c.d_vatom(i,5) += 0.5*v5; - } - } - } - } - - KOKKOS_INLINE_FUNCTION - void operator()(const int i) const { - compute_item<0,0>(i,list,typename DoCoul::type()); - } - - KOKKOS_INLINE_FUNCTION - void operator()(const int i, value_type &energy_virial) const { - energy_virial += compute_item<1,0>(i,list,typename DoCoul::type()); - } - - KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::TeamPolicy<>::member_type& team) const - {} - - KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::TeamPolicy<>::member_type& team, value_type &energy_virial) const - {} - -}; // Filter out Neighflags which are not supported for PairStyle // The enable_if clause will invalidate the last parameter of the function, so that @@ -867,7 +727,7 @@ int GetTeamSize(FunctorStyle& functor, int inum, int reduce_flag, int team_size, return team_size; } -// Submit ParallelFor for NEIGHFLAG=HALF,HALFTHREAD,FULL,N2 +// Submit ParallelFor for NEIGHFLAG=HALF,HALFTHREAD,FULL template EV_FLOAT pair_compute_neighlist (PairStyle* fpair, typename std::enable_if<(NEIGHFLAG&PairStyle::EnabledNeighFlags) != 0, NeighListKokkos*>::type list) { EV_FLOAT ev; @@ -918,8 +778,6 @@ EV_FLOAT pair_compute (PairStyle* fpair, NeighListKokkos (fpair,list); } else if (fpair->neighflag == HALF) { ev = pair_compute_neighlist (fpair,list); - } else if (fpair->neighflag == N2) { - ev = pair_compute_neighlist (fpair,list); } return ev; } diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp index 37485c77f0..b8c72d7b88 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp @@ -309,9 +309,6 @@ void PairLJClass2CoulCutKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/class2/coul/cut/kk"); } diff --git a/src/KOKKOS/pair_lj_class2_kokkos.cpp b/src/KOKKOS/pair_lj_class2_kokkos.cpp index dd99ea9ab5..5bac4c8140 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_kokkos.cpp @@ -247,9 +247,6 @@ void PairLJClass2Kokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/class2/kk"); } diff --git a/src/KOKKOS/pair_lj_class2_kokkos.h b/src/KOKKOS/pair_lj_class2_kokkos.h index ae0676c8a5..4bfc44ee6f 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_kokkos.h @@ -31,7 +31,7 @@ namespace LAMMPS_NS { template class PairLJClass2Kokkos : public PairLJClass2 { public: - enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2}; + enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes AT; @@ -104,15 +104,12 @@ class PairLJClass2Kokkos : public PairLJClass2 { friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class 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*); - friend EV_FLOAT pair_compute_neighlist(PairLJClass2Kokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute(PairLJClass2Kokkos*,NeighListKokkos*); friend void pair_virial_fdotr_compute(PairLJClass2Kokkos*); }; diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp index 36fd960c98..e2b57e8df7 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp @@ -300,9 +300,6 @@ void PairLJCutCoulCutKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/coul/cut/kk"); } diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp index 3810a0140b..bc8369fd65 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp @@ -329,9 +329,6 @@ void PairLJCutCoulDebyeKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/coul/debye/kk"); } diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp index b8818b1098..feb6a58136 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp @@ -322,9 +322,6 @@ void PairLJCutCoulDSFKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/coul/cut/kk"); } diff --git a/src/KOKKOS/pair_lj_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_kokkos.cpp index a4b2e90e07..5eb0a5b91a 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_kokkos.cpp @@ -241,9 +241,6 @@ void PairLJCutKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/kk"); } diff --git a/src/KOKKOS/pair_lj_cut_kokkos.h b/src/KOKKOS/pair_lj_cut_kokkos.h index 7e2b8fd91a..122aef5a1e 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_kokkos.h @@ -31,7 +31,7 @@ namespace LAMMPS_NS { template class PairLJCutKokkos : public PairLJCut { public: - enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2}; + enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes AT; @@ -99,15 +99,12 @@ class PairLJCutKokkos : public PairLJCut { friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class 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*); - friend EV_FLOAT pair_compute_neighlist(PairLJCutKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute(PairLJCutKokkos*,NeighListKokkos*); friend void pair_virial_fdotr_compute(PairLJCutKokkos*); }; diff --git a/src/KOKKOS/pair_lj_expand_kokkos.cpp b/src/KOKKOS/pair_lj_expand_kokkos.cpp index 496a7a76ac..0409eda401 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.cpp +++ b/src/KOKKOS/pair_lj_expand_kokkos.cpp @@ -249,9 +249,6 @@ void PairLJExpandKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/expand/kk"); } diff --git a/src/KOKKOS/pair_lj_expand_kokkos.h b/src/KOKKOS/pair_lj_expand_kokkos.h index 093031f7d7..bdd0bf5870 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.h +++ b/src/KOKKOS/pair_lj_expand_kokkos.h @@ -31,7 +31,7 @@ namespace LAMMPS_NS { template class PairLJExpandKokkos : public PairLJExpand { public: - enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2}; + enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes AT; @@ -105,15 +105,12 @@ class PairLJExpandKokkos : public PairLJExpand { friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class 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*); - friend EV_FLOAT pair_compute_neighlist(PairLJExpandKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute(PairLJExpandKokkos*,NeighListKokkos*); friend void pair_virial_fdotr_compute(PairLJExpandKokkos*); }; diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.cpp b/src/KOKKOS/pair_lj_sdk_kokkos.cpp index 645f8a9159..70d04385d0 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.cpp +++ b/src/KOKKOS/pair_lj_sdk_kokkos.cpp @@ -279,9 +279,6 @@ void PairLJSDKKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/sdk/kk"); } diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.h b/src/KOKKOS/pair_lj_sdk_kokkos.h index f313c4342f..db71dc4677 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.h +++ b/src/KOKKOS/pair_lj_sdk_kokkos.h @@ -31,7 +31,7 @@ namespace LAMMPS_NS { template class PairLJSDKKokkos : public PairLJSDK { public: - enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2}; + enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes AT; @@ -100,15 +100,12 @@ class PairLJSDKKokkos : public PairLJSDK { friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class 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*); - friend EV_FLOAT pair_compute_neighlist(PairLJSDKKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute(PairLJSDKKokkos*,NeighListKokkos*); friend void pair_virial_fdotr_compute(PairLJSDKKokkos*); }; diff --git a/src/KOKKOS/pair_morse_kokkos.cpp b/src/KOKKOS/pair_morse_kokkos.cpp index 4e88c72518..16d4d8a0a3 100644 --- a/src/KOKKOS/pair_morse_kokkos.cpp +++ b/src/KOKKOS/pair_morse_kokkos.cpp @@ -258,9 +258,6 @@ void PairMorseKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with morse/kk"); } diff --git a/src/KOKKOS/pair_morse_kokkos.h b/src/KOKKOS/pair_morse_kokkos.h index f9cce941a5..ff3c552437 100644 --- a/src/KOKKOS/pair_morse_kokkos.h +++ b/src/KOKKOS/pair_morse_kokkos.h @@ -31,7 +31,7 @@ namespace LAMMPS_NS { template class PairMorseKokkos : public PairMorse { public: - enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2}; + enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; typedef DeviceType device_type; PairMorseKokkos(class LAMMPS *); @@ -98,15 +98,12 @@ class PairMorseKokkos : public PairMorse { friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class 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*); - friend EV_FLOAT pair_compute_neighlist(PairMorseKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute(PairMorseKokkos*,NeighListKokkos*); friend void pair_virial_fdotr_compute(PairMorseKokkos*); }; diff --git a/src/KOKKOS/pair_table_kokkos.cpp b/src/KOKKOS/pair_table_kokkos.cpp index a86db70d4d..b2aaaf1566 100644 --- a/src/KOKKOS/pair_table_kokkos.cpp +++ b/src/KOKKOS/pair_table_kokkos.cpp @@ -136,12 +136,6 @@ void PairTableKokkos::compute_style(int eflag_in, int vflag_in) if (eflag || vflag) Kokkos::parallel_reduce(list->inum,f,ev); else Kokkos::parallel_for(list->inum,f); f.contribute(); - } else if (neighflag == N2) { - PairComputeFunctor,N2,false,S_TableCompute > - f(this,(NeighListKokkos*) list); - if (eflag || vflag) Kokkos::parallel_reduce(list->inum,f,ev); - else Kokkos::parallel_for(list->inum,f); - f.contribute(); } } else { if (neighflag == FULL) { @@ -162,12 +156,6 @@ void PairTableKokkos::compute_style(int eflag_in, int vflag_in) if (eflag || vflag) Kokkos::parallel_reduce(list->inum,f,ev); else Kokkos::parallel_for(list->inum,f); f.contribute(); - } else if (neighflag == N2) { - PairComputeFunctor,N2,true,S_TableCompute > - f(this,(NeighListKokkos*) list); - if (eflag || vflag) Kokkos::parallel_reduce(list->inum,f,ev); - else Kokkos::parallel_for(list->inum,f); - f.contribute(); } } @@ -525,9 +513,6 @@ void PairTableKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/kk"); } diff --git a/src/KOKKOS/pair_table_kokkos.h b/src/KOKKOS/pair_table_kokkos.h index eede023d7e..2f84e6a61e 100644 --- a/src/KOKKOS/pair_table_kokkos.h +++ b/src/KOKKOS/pair_table_kokkos.h @@ -41,7 +41,7 @@ template class PairTableKokkos : public PairTable { public: - enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2}; + enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes AT; @@ -139,38 +139,30 @@ class PairTableKokkos : public PairTable { friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; - friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; - friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; - friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; - friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; - friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; - friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; - friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; friend class PairComputeFunctor >; - friend class 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 d78a5ee646..2b066d7633 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.cpp +++ b/src/KOKKOS/pair_table_rx_kokkos.cpp @@ -665,8 +665,6 @@ void PairTableRXKokkos::compute_style(int eflag_in, int vflag_in) nspecies, isite1, isite2, fractionalWeighting, mixWtSite1old, mixWtSite2old, mixWtSite1, mixWtSite2); - if (neighflag == N2) error->all(FLERR,"pair table/rx/kk can't handle N2 yet\n"); - NeighListKokkos* l = dynamic_cast*>(list); @@ -1282,9 +1280,6 @@ void PairTableRXKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/kk"); } diff --git a/src/KOKKOS/pair_table_rx_kokkos.h b/src/KOKKOS/pair_table_rx_kokkos.h index 4230263dc9..7aba307476 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.h +++ b/src/KOKKOS/pair_table_rx_kokkos.h @@ -30,7 +30,7 @@ namespace LAMMPS_NS { template class PairTableRXKokkos : public PairTable { public: - enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2}; + enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; typedef DeviceType device_type; PairTableRXKokkos(class LAMMPS *); diff --git a/src/KOKKOS/pair_yukawa_kokkos.h b/src/KOKKOS/pair_yukawa_kokkos.h index 5f4e823657..f24298d415 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.h +++ b/src/KOKKOS/pair_yukawa_kokkos.h @@ -103,19 +103,15 @@ class PairYukawaKokkos : public PairYukawa { friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; friend class PairComputeFunctor; - friend class PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist( PairYukawaKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist( PairYukawaKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist( PairYukawaKokkos*,NeighListKokkos*); - friend EV_FLOAT pair_compute_neighlist( - PairYukawaKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute( PairYukawaKokkos*,NeighListKokkos*); friend void pair_virial_fdotr_compute(PairYukawaKokkos*); diff --git a/src/KOKKOS/pair_zbl_kokkos.cpp b/src/KOKKOS/pair_zbl_kokkos.cpp index fe34f58fa6..5e4ec398d9 100644 --- a/src/KOKKOS/pair_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_zbl_kokkos.cpp @@ -103,9 +103,6 @@ void PairZBLKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/kk"); } diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index 62d7ccc3cd..0940bda7ac 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -106,7 +106,7 @@ PPPMKokkos::PPPMKokkos(LAMMPS *lmp) : PPPM(lmp) // see JCP 109, pg 7698 for derivation of coefficients // higher order coefficients may be computed if needed - acons = typename Kokkos::DualView::t_host("pppm:acons"); + acons = typename Kokkos::DualView::t_host("pppm:acons"); acons(1,0) = 2.0 / 3.0; acons(2,0) = 1.0 / 50.0; acons(2,1) = 5.0 / 294.0; @@ -2581,7 +2581,7 @@ void PPPMKokkos::operator()(TagPPPM_fieldforce_peratom, const int &i ------------------------------------------------------------------------- */ template -void PPPMKokkos::pack_forward_kspace_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +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) { typename AT::t_int_2d_um d_list = k_list.view(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); @@ -2637,7 +2637,7 @@ void PPPMKokkos::operator()(TagPPPM_pack_forward2, const int &i) con ------------------------------------------------------------------------- */ template -void PPPMKokkos::unpack_forward_kspace_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +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) { typename AT::t_int_2d_um d_list = k_list.view(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); @@ -2694,7 +2694,7 @@ void PPPMKokkos::operator()(TagPPPM_unpack_forward2, const int &i) c ------------------------------------------------------------------------- */ template -void PPPMKokkos::pack_reverse_kspace_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +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) { typename AT::t_int_2d_um d_list = k_list.view(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); @@ -2724,7 +2724,7 @@ void PPPMKokkos::operator()(TagPPPM_pack_reverse, const int &i) cons ------------------------------------------------------------------------- */ template -void PPPMKokkos::unpack_reverse_kspace_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +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) { typename AT::t_int_2d_um d_list = k_list.view(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); diff --git a/src/KOKKOS/pppm_kokkos.h b/src/KOKKOS/pppm_kokkos.h index a07ed7d7c4..847a2f807f 100644 --- a/src/KOKKOS/pppm_kokkos.h +++ b/src/KOKKOS/pppm_kokkos.h @@ -403,10 +403,10 @@ class PPPMKokkos : public PPPM, public KokkosBaseFFT { // grid communication - void pack_forward_kspace_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); - void unpack_forward_kspace_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); - void pack_reverse_kspace_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); - void unpack_reverse_kspace_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); + void pack_forward_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int); + void unpack_forward_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int); + void pack_reverse_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int); + void unpack_reverse_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int); // triclinic diff --git a/src/MAKE/MINE/... b/src/MAKE/MINE/... deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/MAKE/MINE/.gitignore b/src/MAKE/MINE/.gitignore new file mode 100644 index 0000000000..9c45e661e8 --- /dev/null +++ b/src/MAKE/MINE/.gitignore @@ -0,0 +1 @@ +/Makefile.* diff --git a/src/MAKE/OPTIONS/Makefile.hip b/src/MAKE/OPTIONS/Makefile.hip index 76affc796c..062b92fb6d 100644 --- a/src/MAKE/OPTIONS/Makefile.hip +++ b/src/MAKE/OPTIONS/Makefile.hip @@ -27,12 +27,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -45,7 +45,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -56,7 +56,7 @@ FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -91,18 +91,22 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules diff --git a/src/USER-MISC/pair_drip.cpp b/src/USER-MISC/pair_drip.cpp index 020216f503..bb28d056ac 100644 --- a/src/USER-MISC/pair_drip.cpp +++ b/src/USER-MISC/pair_drip.cpp @@ -33,6 +33,7 @@ #include "neigh_request.h" #include "memory.h" #include "error.h" +#include "utils.h" using namespace LAMMPS_NS; @@ -116,8 +117,8 @@ void PairDRIP::allocate() void PairDRIP::settings(int narg, char ** /* arg */) { if (narg != 0) error->all(FLERR,"Illegal pair_style command"); - if (strcmp(force->pair_style,"hybrid/overlay")!=0) - error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); + if (!utils::strmatch(force->pair_style,"^hybrid/overlay")) + error->all(FLERR,"Pair style drip must be used as sub-style with hybrid/overlay"); } /* ---------------------------------------------------------------------- diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 44e2bd172e..39750dd7da 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -39,6 +39,8 @@ Contributing Author: Jacob Gissinger (jacob.gissinger@colorado.edu) #include "math_extra.h" #include "memory.h" #include "error.h" +#include "input.h" +#include "variable.h" #include @@ -61,6 +63,7 @@ static const char cite_fix_bond_react[] = #define DELTA 16 #define MAXGUESS 20 // max # of guesses allowed by superimpose algorithm #define MAXCONARGS 10 // max # of arguments for any type of constraint + rxnID +#define NUMVARVALS 4 // max # of keyword values that have variables as input // various statuses of superimpose algorithm: // ACCEPT: site successfully matched to pre-reacted template @@ -74,6 +77,9 @@ enum{ACCEPT,REJECT,PROCEED,CONTINUE,GUESSFAIL,RESTORE}; // types of available reaction constraints enum{DISTANCE,ANGLE,DIHEDRAL,ARRHENIUS}; +// keyword values that accept variables as input +enum{NEVERY,RMIN,RMAX,PROB}; + /* ---------------------------------------------------------------------- */ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : @@ -178,6 +184,8 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(stabilize_steps_flag,nreacts,"bond/react:stabilize_steps_flag"); memory->create(update_edges_flag,nreacts,"bond/react:update_edges_flag"); 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"); memory->create(iatomtype,nreacts,"bond/react:iatomtype"); memory->create(jatomtype,nreacts,"bond/react:jatomtype"); memory->create(ibonding,nreacts,"bond/react:ibonding"); @@ -201,6 +209,10 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : local_rxn_count[i] = 0; ghostly_rxn_count[i] = 0; reaction_count_total[i] = 0; + for (int j = 0; j < NUMVARVALS; j++) { + var_flag[j][i] = 0; + var_id[j][i] = 0; + } } char **files; @@ -221,19 +233,65 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : if (igroup == -1) error->all(FLERR,"Could not find fix group ID"); groupbits[rxn] = group->bitmask[igroup]; - nevery[rxn] = force->inumeric(FLERR,arg[iarg++]); - if (nevery[rxn] <= 0) error->all(FLERR,"Illegal fix bond/react command: " - "'Nevery' must be a positive integer"); + if (strncmp(arg[iarg],"v_",2) == 0) { + n = strlen(&arg[iarg][2]) + 1; + char *str = new char[n]; + strcpy(str,&arg[iarg][2]); + var_id[NEVERY][rxn] = input->variable->find(str); + if (var_id[NEVERY][rxn] < 0) + error->all(FLERR,"Bond/react: Variable name does not exist"); + if (!input->variable->equalstyle(var_id[NEVERY][rxn])) + error->all(FLERR,"Bond/react: Variable is not equal-style"); + var_flag[NEVERY][rxn] = 1; + delete [] str; + } else { + nevery[rxn] = force->inumeric(FLERR,arg[iarg]); + if (nevery[rxn] <= 0) error->all(FLERR,"Illegal fix bond/react command: " + "'Nevery' must be a positive integer"); + } + iarg++; - double cutoff = force->numeric(FLERR,arg[iarg++]); - if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/react command: " - "'Rmin' cannot be negative"); - cutsq[rxn][0] = cutoff*cutoff; + if (strncmp(arg[iarg],"v_",2) == 0) { + n = strlen(&arg[iarg][2]) + 1; + char *str = new char[n]; + strcpy(str,&arg[iarg][2]); + var_id[RMIN][rxn] = input->variable->find(str); + if (var_id[RMIN][rxn] < 0) + error->all(FLERR,"Bond/react: Variable name does not exist"); + if (!input->variable->equalstyle(var_id[RMIN][rxn])) + error->all(FLERR,"Bond/react: Variable is not equal-style"); + double cutoff = input->variable->compute_equal(var_id[RMIN][rxn]); + cutsq[rxn][0] = cutoff*cutoff; + var_flag[RMIN][rxn] = 1; + delete [] str; + } else { + double cutoff = force->numeric(FLERR,arg[iarg]); + if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/react command: " + "'Rmin' cannot be negative"); + cutsq[rxn][0] = cutoff*cutoff; + } + iarg++; - cutoff = force->numeric(FLERR,arg[iarg++]); - if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/react command:" - "'Rmax' cannot be negative"); - cutsq[rxn][1] = cutoff*cutoff; + if (strncmp(arg[iarg],"v_",2) == 0) { + n = strlen(&arg[iarg][2]) + 1; + char *str = new char[n]; + strcpy(str,&arg[iarg][2]); + var_id[RMAX][rxn] = input->variable->find(str); + if (var_id[RMAX][rxn] < 0) + error->all(FLERR,"Bond/react: Variable name does not exist"); + if (!input->variable->equalstyle(var_id[RMAX][rxn])) + error->all(FLERR,"Bond/react: Variable is not equal-style"); + double cutoff = input->variable->compute_equal(var_id[RMAX][rxn]); + cutsq[rxn][1] = cutoff*cutoff; + var_flag[RMAX][rxn] = 1; + delete [] str; + } else { + double cutoff = force->numeric(FLERR,arg[iarg]); + if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/react command:" + "'Rmax' cannot be negative"); + cutsq[rxn][1] = cutoff*cutoff; + } + iarg++; unreacted_mol[rxn] = atom->find_molecule(arg[iarg++]); if (unreacted_mol[rxn] == -1) error->all(FLERR,"Unreacted molecule template ID for " @@ -251,7 +309,23 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"prob") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/react command: " "'prob' keyword has too few arguments"); - fraction[rxn] = force->numeric(FLERR,arg[iarg+1]); + // check if probability is a variable + if (strncmp(arg[iarg+1],"v_",2) == 0) { + int n = strlen(&arg[iarg+1][2]) + 1; + char *str = new char[n]; + strcpy(str,&arg[iarg+1][2]); + var_id[PROB][rxn] = input->variable->find(str); + if (var_id[PROB][rxn] < 0) + error->all(FLERR,"Bond/react: Variable name does not exist"); + if (!input->variable->equalstyle(var_id[PROB][rxn])) + error->all(FLERR,"Bond/react: Variable is not equal-style"); + fraction[rxn] = input->variable->compute_equal(var_id[PROB][rxn]); + var_flag[PROB][rxn] = 1; + delete [] str; + } else { + // otherwise probability should be a number + fraction[rxn] = force->numeric(FLERR,arg[iarg+1]); + } seed[rxn] = force->inumeric(FLERR,arg[iarg+2]); if (fraction[rxn] < 0.0 || fraction[rxn] > 1.0) error->all(FLERR,"Illegal fix bond/react command: " @@ -260,12 +334,12 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : "probability seed must be positive"); iarg += 3; } 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]); - if (max_rxn[rxn] < 0) error->all(FLERR,"Illegal fix bond/react command: " - "'max_rxn' cannot be negative"); - iarg += 2; + 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]); + if (max_rxn[rxn] < 0) error->all(FLERR,"Illegal fix bond/react command: " + "'max_rxn' cannot be negative"); + iarg += 2; } else if (strcmp(arg[iarg],"stabilize_steps") == 0) { if (stabilization_flag == 0) error->all(FLERR,"Stabilize_steps keyword " "used without stabilization keyword"); @@ -447,6 +521,8 @@ FixBondReact::~FixBondReact() memory->destroy(nlocalskips); memory->destroy(nghostlyskips); memory->destroy(limit_duration); + memory->destroy(var_flag); + memory->destroy(var_id); memory->destroy(stabilize_steps_flag); memory->destroy(update_edges_flag); @@ -628,36 +704,36 @@ void FixBondReact::post_constructor() i_statted_tags[i] = 1; } } else { - // sleeping code, for future capabilities - custom_exclude_flag = 1; - // first we have to find correct fix group reference - int n = strlen("GROUP_") + strlen(exclude_group) + 1; - char *fix_group = new char[n]; - strcpy(fix_group,"GROUP_"); - strcat(fix_group,exclude_group); - int ifix = modify->find_fix(fix_group); - Fix *fix = modify->fix[ifix]; - delete [] fix_group; + // sleeping code, for future capabilities + custom_exclude_flag = 1; + // first we have to find correct fix group reference + int n = strlen("GROUP_") + strlen(exclude_group) + 1; + char *fix_group = new char[n]; + strcpy(fix_group,"GROUP_"); + strcat(fix_group,exclude_group); + int ifix = modify->find_fix(fix_group); + Fix *fix = modify->fix[ifix]; + delete [] fix_group; - // this returns names of corresponding property - int unused; - char * idprop; - idprop = (char *) fix->extract("property",unused); - if (idprop == NULL) - error->all(FLERR,"Exclude group must be a per-atom property group"); + // this returns names of corresponding property + int unused; + char * idprop; + idprop = (char *) fix->extract("property",unused); + if (idprop == NULL) + error->all(FLERR,"Exclude group must be a per-atom property group"); - len = strlen(idprop) + 1; - statted_id = new char[len]; - strcpy(statted_id,idprop); + len = strlen(idprop) + 1; + statted_id = new char[len]; + strcpy(statted_id,idprop); - // initialize per-atom statted_tags to 1 - // need to correct for smooth restarts - //int flag; - //int index = atom->find_custom(statted_id,flag); - //int *i_statted_tags = atom->ivector[index]; - //for (int i = 0; i < atom->nlocal; i++) - // i_statted_tags[i] = 1; - } + // initialize per-atom statted_tags to 1 + // need to correct for smooth restarts + //int flag; + //int index = atom->find_custom(statted_id,flag); + //int *i_statted_tags = atom->ivector[index]; + //for (int i = 0; i < atom->nlocal; i++) + // i_statted_tags[i] = 1; + } // let's create a new nve/limit fix to limit newly reacted atoms @@ -720,6 +796,11 @@ void FixBondReact::post_integrate() // check if any reactions could occur on this timestep int nevery_check = 1; for (int i = 0; i < nreacts; i++) { + if (var_flag[NEVERY][i]) + nevery[i] = ceil(input->variable->compute_equal(var_id[NEVERY][i])); + if (nevery[i] <= 0) + error->all(FLERR,"Illegal fix bond/react command: " + "'Nevery' must be a positive integer"); if (!(update->ntimestep % nevery[i])) { nevery_check = 0; break; @@ -824,13 +905,17 @@ void FixBondReact::post_integrate() comm->reverse_comm_fix(this); } + // update reaction probability + if (var_flag[PROB][rxnID]) + fraction[rxnID] = input->variable->compute_equal(var_id[PROB][rxnID]); + // each atom now knows its winning partner // for prob check, generate random value for each atom with a bond partner // forward comm of partner and random value, so ghosts have it if (fraction[rxnID] < 1.0) { for (int i = 0; i < nlocal; i++) - if (partner[i]) probability[i] = random[rxnID]->uniform(); + if (partner[i]) probability[i] = random[rxnID]->uniform(); } commflag = 2; @@ -1003,6 +1088,14 @@ void FixBondReact::far_partner() domain->minimum_image(delx,dely,delz); // ghost location fix rsq = delx*delx + dely*dely + delz*delz; + if (var_flag[RMIN][rxnID]) { + double cutoff = input->variable->compute_equal(var_id[RMIN][rxnID]); + cutsq[rxnID][0] = cutoff*cutoff; + } + if (var_flag[RMAX][rxnID]) { + double cutoff = input->variable->compute_equal(var_id[RMAX][rxnID]); + cutsq[rxnID][1] = cutoff*cutoff; + } if (rsq >= cutsq[rxnID][1] || rsq <= cutsq[rxnID][0]) { continue; } @@ -1058,6 +1151,15 @@ void FixBondReact::close_partner() delz = x[i1][2] - x[i2][2]; domain->minimum_image(delx,dely,delz); // ghost location fix rsq = delx*delx + dely*dely + delz*delz; + + if (var_flag[RMIN][rxnID]) { + double cutoff = input->variable->compute_equal(var_id[RMIN][rxnID]); + cutsq[rxnID][0] = cutoff*cutoff; + } + if (var_flag[RMAX][rxnID]) { + double cutoff = input->variable->compute_equal(var_id[RMAX][rxnID]); + cutsq[rxnID][1] = cutoff*cutoff; + } if (rsq >= cutsq[rxnID][1] || rsq <= cutsq[rxnID][0]) continue; if (closeneigh[rxnID] == 0) { @@ -1770,7 +1872,7 @@ int FixBondReact::check_constraints() } else if (constraints[i][1] == ARRHENIUS) { t = get_temperature(); prrhob = constraints[i][3]*pow(t,constraints[i][4])* - exp(-constraints[i][5]/(force->boltz*t)); + exp(-constraints[i][5]/(force->boltz*t)); if (prrhob < rrhandom[(int) constraints[i][2]]->uniform()) return 0; } } @@ -1822,13 +1924,13 @@ double FixBondReact::get_temperature() for (i = 0; i < onemol->natoms; i++) { ilocal = atom->map(glove[i][1]); t += (v[ilocal][0]*v[ilocal][0] + v[ilocal][1]*v[ilocal][1] + - v[ilocal][2]*v[ilocal][2]) * rmass[ilocal]; + v[ilocal][2]*v[ilocal][2]) * rmass[ilocal]; } } else { for (i = 0; i < onemol->natoms; i++) { ilocal = atom->map(glove[i][1]); t += (v[ilocal][0]*v[ilocal][0] + v[ilocal][1]*v[ilocal][1] + - v[ilocal][2]*v[ilocal][2]) * mass[type[ilocal]]; + v[ilocal][2]*v[ilocal][2]) * mass[type[ilocal]]; } } @@ -1857,7 +1959,7 @@ int FixBondReact::get_chirality(double four_coords[12]) for (int i = 0; i < 3; i++) { mean3[i] = (four_coords[i] + four_coords[i+3] + - four_coords[i+6])/3; + four_coords[i+6])/3; vec4[i] = four_coords[i+9] - mean3[i]; } @@ -2005,7 +2107,7 @@ void FixBondReact::find_landlocked_atoms(int myrxn) int ii = reverse_equiv[i][1][myrxn] - 1; for (int j = 0; j < twomol_nxspecial[ii][0]; j++) { if (delete_atoms[equivalences[twomol_xspecial[ii][j]-1][1][myrxn]-1][myrxn] == 0) { - error->all(FLERR,"Bond/react: A deleted atom cannot remain bonded to an atom that is not deleted"); + error->all(FLERR,"Bond/react: A deleted atom cannot remain bonded to an atom that is not deleted"); } } } @@ -2292,19 +2394,19 @@ void FixBondReact::glove_ghostcheck() // 'ghosts of another' indication taken from comm->sendlist int ghostly = 0; - #if !defined(MPI_STUBS) - if (comm->style == 0) { - for (int i = 0; i < onemol->natoms; i++) { - int ilocal = atom->map(glove[i][1]); - if (ilocal >= atom->nlocal || localsendlist[ilocal] == 1) { - ghostly = 1; - break; - } +#if !defined(MPI_STUBS) + if (comm->style == 0) { + for (int i = 0; i < onemol->natoms; i++) { + int ilocal = atom->map(glove[i][1]); + if (ilocal >= atom->nlocal || localsendlist[ilocal] == 1) { + ghostly = 1; + break; } - } else { - ghostly = 1; } - #endif + } else { + ghostly = 1; + } +#endif if (ghostly == 1) { ghostly_mega_glove[0][ghostly_num_mega] = rxnID; @@ -2378,12 +2480,12 @@ void FixBondReact::ghost_glovecast() // let's send to root, dedup, then broadcast if (me == 0) { MPI_Gatherv(MPI_IN_PLACE, ghostly_num_mega, column, // Note: some values ignored for MPI_IN_PLACE - &(global_mega_glove[0][0]), allncols, allstarts, - column, 0, world); + &(global_mega_glove[0][0]), allncols, allstarts, + column, 0, world); } else { MPI_Gatherv(&(global_mega_glove[0][start]), ghostly_num_mega, column, - &(global_mega_glove[0][0]), allncols, allstarts, - column, 0, world); + &(global_mega_glove[0][0]), allncols, allstarts, + column, 0, world); } if (me == 0) dedup_mega_gloves(1); // global_mega_glove mode @@ -2990,7 +3092,7 @@ void FixBondReact::read(int myrxn) sscanf(line,"%d",&nequivalent); if (nequivalent != onemol->natoms) error->one(FLERR,"Bond/react: Number of equivalences in map file must " - "equal number of atoms in reaction templates"); + "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); @@ -3183,7 +3285,7 @@ void FixBondReact::Constraints(char *line, int myrxn) tmp[6] = 181.0; // impossible range tmp[7] = 182.0; sscanf(line,"%*s %lg %lg %lg %lg %lg %lg %lg %lg",&tmp[0],&tmp[1], - &tmp[2],&tmp[3],&tmp[4],&tmp[5],&tmp[6],&tmp[7]); + &tmp[2],&tmp[3],&tmp[4],&tmp[5],&tmp[6],&tmp[7]); if (tmp[0] > onemol->natoms || tmp[1] > onemol->natoms || tmp[2] > onemol->natoms || tmp[3] > onemol->natoms) error->one(FLERR,"Bond/react: Invalid template atom ID in map file"); @@ -3411,16 +3513,17 @@ void FixBondReact::unpack_reverse_comm(int n, int *list, double *buf) if (commflag != 1) { for (i = 0; i < n; i++) { j = list[i]; - if (closeneigh[rxnID] != 0) + if (closeneigh[rxnID] != 0) { if (buf[m+1] < distsq[j][1]) { - partner[j] = (tagint) ubuf(buf[m++]).i; + partner[j] = (tagint) ubuf(buf[m++]).i; distsq[j][1] = buf[m++]; } else m += 2; - else + } else { if (buf[m+1] > distsq[j][0]) { partner[j] = (tagint) ubuf(buf[m++]).i; distsq[j][0] = buf[m++]; } else m += 2; + } } } } @@ -3478,9 +3581,9 @@ double FixBondReact::memory_usage() void FixBondReact::print_bb() { - +#if 0 //fix bond/create cargo code. eg nbonds needs to be added - /* + for (int i = 0; i < atom->nlocal; i++) { // printf("TAG " TAGINT_FORMAT ": %d nbonds: ",atom->tag[i],atom->num_bond[i]); for (int j = 0; j < atom->num_bond[i]; j++) { @@ -3513,9 +3616,9 @@ for (int i = 0; i < atom->nlocal; i++) { // printf("TAG " TAGINT_FORMAT ": %d %d %d nspecial: ",atom->tag[i], atom->nspecial[i][0],atom->nspecial[i][1],atom->nspecial[i][2]); for (int j = 0; j < atom->nspecial[i][2]; j++) { - // printf(" " TAGINT_FORMAT,atom->special[i][j]); + printf(" " TAGINT_FORMAT,atom->special[i][j]); } // printf("\n"); } -*/ +#endif } diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index 84cb9401f8..722a533bbf 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -67,6 +67,7 @@ class FixBondReact : public Fix { int nconstraints; int narrhenius; double **constraints; + int **var_flag,**var_id; // for keyword values with variable inputs int status; int *groupbits; @@ -279,4 +280,12 @@ The number of bonds, angles etc per-atom created by a reaction exceeds the system setting. See the read_data or create_box command for how to specify this value. +E: Bond/react: Variable name does not exist + +Self-explanatory. + +E: Bond/react: Variable is not equal-style + +Self-explanatory. + */ diff --git a/src/neigh_list.cpp b/src/neigh_list.cpp index 1c53b2f7a4..c01f8ca595 100644 --- a/src/neigh_list.cpp +++ b/src/neigh_list.cpp @@ -80,6 +80,7 @@ NeighList::NeighList(LAMMPS *lmp) : Pointers(lmp) // Kokkos package kokkos = 0; + kk2cpu = 0; execution_space = Host; // USER-DPD package @@ -143,8 +144,11 @@ void NeighList::post_constructor(NeighRequest *nq) respainner = nq->respainner; copy = nq->copy; - if (nq->copy) + if (nq->copy) { listcopy = neighbor->lists[nq->copylist]; + if (listcopy->kokkos && !this->kokkos) + kk2cpu = 1; + } if (nq->skip) { listskip = neighbor->lists[nq->skiplist]; diff --git a/src/neigh_list.h b/src/neigh_list.h index 146a01e7b5..501188a724 100644 --- a/src/neigh_list.h +++ b/src/neigh_list.h @@ -42,6 +42,7 @@ class NeighList : protected Pointers { int respamiddle; // 1 if there is also a rRespa middle list int respainner; // 1 if there is also a rRespa inner list int copy; // 1 if this list is copied from another list + int kk2cpu; // 1 if this list is copied from Kokkos to CPU int copymode; // 1 if this is a Kokkos on-device copy // data structs to store neighbor pairs I,J and associated values diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 3d1f37a03b..5783c24d2d 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -849,7 +849,8 @@ int Neighbor::init_pair() // allocate initial pages for each list, except if copy flag set for (i = 0; i < nlist; i++) { - if (lists[i]->copy) continue; + if (lists[i]->copy && !lists[i]->kk2cpu) + continue; lists[i]->setup_pages(pgsize,oneatom); } @@ -860,8 +861,10 @@ int Neighbor::init_pair() // also Kokkos list initialization int maxatom = atom->nmax; - for (i = 0; i < nlist; i++) - if (neigh_pair[i] && !lists[i]->copy) lists[i]->grow(maxatom,maxatom); + for (i = 0; i < nlist; i++) { + if (neigh_pair[i] && (!lists[i]->copy || lists[i]->kk2cpu)) + lists[i]->grow(maxatom,maxatom); + } // plist = indices of perpetual NPair classes // perpetual = non-occasional, re-built at every reneighboring @@ -1257,8 +1260,8 @@ void Neighbor::morph_copy() if (irq->history != jrq->history) continue; if (irq->bond != jrq->bond) continue; if (irq->intel != jrq->intel) continue; - if (irq->kokkos_host != jrq->kokkos_host) continue; - if (irq->kokkos_device != jrq->kokkos_device) continue; + if (irq->kokkos_host && !jrq->kokkos_host) continue; + if (irq->kokkos_device && !jrq->kokkos_device) continue; if (irq->ssa != jrq->ssa) continue; if (irq->cut != jrq->cut) continue; if (irq->cutoff != jrq->cutoff) continue; @@ -1789,8 +1792,12 @@ int Neighbor::choose_pair(NeighRequest *rq) if (rq->copy) { if (!(mask & NP_COPY)) continue; - if (!rq->kokkos_device != !(mask & NP_KOKKOS_DEVICE)) continue; - if (!rq->kokkos_host != !(mask & NP_KOKKOS_HOST)) continue; + if (rq->kokkos_device || rq->kokkos_host) { + if (!rq->kokkos_device != !(mask & NP_KOKKOS_DEVICE)) continue; + if (!rq->kokkos_host != !(mask & NP_KOKKOS_HOST)) continue; + } + if (!requests[rq->copylist]->kokkos_device != !(mask & NP_KOKKOS_DEVICE)) continue; + if (!requests[rq->copylist]->kokkos_host != !(mask & NP_KOKKOS_HOST)) continue; return i+1; } @@ -2102,7 +2109,8 @@ void Neighbor::build(int topoflag) for (i = 0; i < npair_perpetual; i++) { m = plist[i]; - if (!lists[m]->copy) lists[m]->grow(nlocal,nall); + if (!lists[i]->copy || lists[i]->kk2cpu) + lists[m]->grow(nlocal,nall); neigh_pair[m]->build_setup(); neigh_pair[m]->build(lists[m]); } @@ -2191,7 +2199,8 @@ void Neighbor::build_one(class NeighList *mylist, int preflag) // build the list - if (!mylist->copy) mylist->grow(atom->nlocal,atom->nlocal+atom->nghost); + if (!mylist->copy || mylist->kk2cpu) + mylist->grow(atom->nlocal,atom->nlocal+atom->nghost); np->build_setup(); np->build(mylist); } diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 4d8d6f6902..bbaa311819 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -1007,7 +1007,7 @@ void *PairHybrid::extract(const char *str, int &dim) for (int m = 0; m < nstyles; m++) { ptr = styles[m]->extract(str,dim); if (ptr && strcmp(str,"cut_coul") == 0) { - if (cutptr && dim != couldim) + if (couldim != -1 && dim != couldim) error->all(FLERR, "Coulomb styles of pair hybrid sub-styles do not match"); double *p_newvalue = (double *) ptr; diff --git a/tools/singularity/README.md b/tools/singularity/README.md index a01b1688b8..abef8b2886 100644 --- a/tools/singularity/README.md +++ b/tools/singularity/README.md @@ -53,7 +53,7 @@ make | ubuntu16.04.def | Ubuntu 16.04LTS with MPI == OpenMPI, no LaTeX | | ubuntu18.04.def | Ubuntu 18.04LTS with MPI == OpenMPI | | ubuntu18.04_amd_rocm.def | Ubuntu 18.04LTS with AMD ROCm toolkit | -| ubuntu18.04_amd_rocm_cuda.def | Ubuntu 18.04LTS with -"- plus Nvidia CUDA 10.2 | +| ubuntu18.04_gpu.def | Ubuntu 18.04LTS with -"- plus Nvidia CUDA 10.2 | | ubuntu18.04_nvidia.def | Ubuntu 18.04LTS with Nvidia CUDA 10.2 toolkit | | ubuntu18.04_intel_opencl.def | Ubuntu 18.04LTS with Intel OpenCL runtime | | ubuntu20.04.def | Ubuntu 20.04LTS with MPI == OpenMPI | diff --git a/tools/singularity/fedora30_mingw.def b/tools/singularity/fedora30_mingw.def index ef83d8f0a7..ab9ea7b738 100644 --- a/tools/singularity/fedora30_mingw.def +++ b/tools/singularity/fedora30_mingw.def @@ -3,9 +3,11 @@ From: fedora:30 %post dnf -y update - dnf -y install vim-enhanced git file make cmake patch which file \ - dos2unix findutils rsync \ - ccache gcc-c++ gdb valgrind eigen3-devel \ + dnf -y install vim-enhanced git file make cmake patch which file Lmod \ + ninja-build clang libomp-devel libubsan libasan libtsan \ + dos2unix findutils rsync python-devel libjpeg-devel libpng-devel \ + ccache gcc-c++ gcc-gfortran gdb valgrind eigen3-devel openblas-devel \ + openmpi-devel mpich-devel fftw-devel voro++-devel gsl-devel \ mingw-filesystem-base mingw32-nsis mingw-binutils-generic \ mingw32-filesystem mingw32-pkg-config \ mingw64-filesystem mingw64-pkg-config \ @@ -39,7 +41,7 @@ From: fedora:30 # we need to reset any module variables # inherited from the host. unset LOADEDMODULES - source /etc/profile.d/modules.sh + . /etc/profile.d/modules.sh module purge module load mpi diff --git a/tools/singularity/fedora32_mingw.def b/tools/singularity/fedora32_mingw.def index 43d5659a19..3f4ded6298 100644 --- a/tools/singularity/fedora32_mingw.def +++ b/tools/singularity/fedora32_mingw.def @@ -38,6 +38,8 @@ From: fedora:32 %environment LC_ALL=C export LC_ALL + # we need to reset any module variables + # inherited from the host. unset LOADEDMODULES . /etc/profile.d/modules.sh module purge diff --git a/tools/singularity/ubuntu18.04_amd_rocm.def b/tools/singularity/ubuntu18.04_amd_rocm.def index 0338ff3c45..ffb609a5c4 100644 --- a/tools/singularity/ubuntu18.04_amd_rocm.def +++ b/tools/singularity/ubuntu18.04_amd_rocm.def @@ -57,12 +57,6 @@ From: rocm/dev-ubuntu-18.04 rocm-libs \ rsync \ ssh \ - texlive \ - texlive-latex-recommended \ - texlive-pictures \ - texlive-publishers \ - texlive-science \ - dvipng \ vim-nox \ virtualenv \ voro++-dev \ diff --git a/tools/singularity/ubuntu18.04_gpu.def b/tools/singularity/ubuntu18.04_gpu.def new file mode 100644 index 0000000000..999b69522d --- /dev/null +++ b/tools/singularity/ubuntu18.04_gpu.def @@ -0,0 +1,94 @@ +BootStrap: docker +From: rocm/dev-ubuntu-18.04 + +%environment + export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 + export CUDADIR=/usr/local/cuda + export CUDA_PATH=/usr/local/cuda + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/nvidia/lib:/usr/local/nvidia/lib64 + export LIBRARY_PATH=/usr/local/cuda/lib64/stubs +%post + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get upgrade --no-install-recommends -y + apt-get install --no-install-recommends -y software-properties-common + apt-get install --no-install-recommends -y \ + bc \ + build-essential \ + ccache \ + clang \ + cmake \ + cmake-curses-gui \ + curl \ + doxygen \ + enchant \ + g++ \ + gcc \ + gfortran \ + git \ + hdf5-tools \ + kmod \ + less \ + libblas-dev \ + libeigen3-dev \ + libenchant-dev \ + libfftw3-dev \ + libgsl-dev \ + libhdf5-serial-dev \ + libhwloc-dev \ + libjpeg-dev \ + liblapack-dev \ + libomp-dev \ + libopenblas-dev \ + libnuma-dev \ + libpng-dev \ + libproj-dev \ + libvtk6-dev \ + make \ + mpi-default-bin \ + mpi-default-dev \ + ninja-build \ + python-dev \ + python-pip \ + python-pygments \ + python-virtualenv \ + python3-dev \ + python3-pip \ + python3-pkg-resources \ + python3-setuptools \ + python3-virtualenv \ + rocm-libs \ + rsync \ + ssh \ + vim-nox \ + virtualenv \ + voro++-dev \ + wget \ + xxd + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin + mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub + add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" + apt-get update + apt-get install --no-install-recommends -y \ + cuda \ + cuda-compiler-10-2 \ + + export PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 + git clone -b master-rocm-3.3 https://github.com/ROCmSoftwarePlatform/hipCUB.git + mkdir hipCUB/build + cd hipCUB/build + CXX=hcc cmake -D BUILD_TEST=off .. + make -j4 + make package + make install + + echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf + echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf + +%environment + LC_ALL=C + export LC_ALL + +%labels + Author rbberger diff --git a/tools/singularity/ubuntu18.04_intel_opencl.def b/tools/singularity/ubuntu18.04_intel_opencl.def index 6dabb94cb1..7f24fb0782 100644 --- a/tools/singularity/ubuntu18.04_intel_opencl.def +++ b/tools/singularity/ubuntu18.04_intel_opencl.def @@ -55,12 +55,6 @@ From: ubuntu:18.04 python3-virtualenv \ rsync \ ssh \ - texlive \ - texlive-latex-recommended \ - texlive-pictures \ - texlive-publishers \ - texlive-science \ - dvipng \ vim-nox \ virtualenv \ voro++-dev \ diff --git a/tools/singularity/ubuntu18.04_nvidia.def b/tools/singularity/ubuntu18.04_nvidia.def index bec17adf7f..6c24fb6d9c 100644 --- a/tools/singularity/ubuntu18.04_nvidia.def +++ b/tools/singularity/ubuntu18.04_nvidia.def @@ -55,12 +55,6 @@ From: nvidia/cuda:10.2-devel-ubuntu18.04 python3-virtualenv \ rsync \ ssh \ - texlive \ - texlive-latex-recommended \ - texlive-pictures \ - texlive-publishers \ - texlive-science \ - dvipng \ vim-nox \ virtualenv \ voro++-dev \