Unverified Commit d7ef1b00 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

Merge branch 'master' into mc-fix-bond-create-angle

parents dee38c26 438346a9
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -193,7 +193,7 @@ if(NOT ${LAMMPS_MEMALIGN} STREQUAL "0")
  target_compile_definitions(lammps PRIVATE -DLAMMPS_MEMALIGN=${LAMMPS_MEMALIGN})
  target_compile_definitions(lammps PRIVATE -DLAMMPS_MEMALIGN=${LAMMPS_MEMALIGN})
endif()
endif()


option(LAMMPS_EXCEPTIONS "enable the use of C++ exceptions for error messages (useful for library interface)" OFF)
option(LAMMPS_EXCEPTIONS "enable the use of C++ exceptions for error messages (useful for library interface)" ${ENABLE_TESTING})
if(LAMMPS_EXCEPTIONS)
if(LAMMPS_EXCEPTIONS)
  target_compile_definitions(lammps PUBLIC -DLAMMPS_EXCEPTIONS)
  target_compile_definitions(lammps PUBLIC -DLAMMPS_EXCEPTIONS)
endif()
endif()
+50 −28
Original line number Original line Diff line number Diff line
@@ -66,29 +66,40 @@ if(GPU_API STREQUAL "CUDA")
  # --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
  # --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
  set(GPU_CUDA_GENCODE "-arch=${GPU_ARCH}")
  set(GPU_CUDA_GENCODE "-arch=${GPU_ARCH}")
  # Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0
  # Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0
  if((CUDA_VERSION VERSION_GREATER "3.1") AND (CUDA_VERSION VERSION_LESS "9.0"))
  if((CUDA_VERSION VERSION_GREATER_EQUAL "3.2") AND (CUDA_VERSION VERSION_LESS "9.0"))
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20] ")
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20] ")
  endif()
  endif()
  # Kepler (GPU Arch 3.x) is supported by CUDA 5 and later
  # Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2
  if(CUDA_VERSION VERSION_GREATER "4.9")
  if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0"))
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30] ")
  endif()
  # Kepler (GPU Arch 3.5) is supported by CUDA 5 to CUDA 11
  if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "12.0"))
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30] -gencode arch=compute_35,code=[sm_35,compute_35]")
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30] -gencode arch=compute_35,code=[sm_35,compute_35]")
  endif()
  endif()
  # Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later
  # Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later
  if(CUDA_VERSION VERSION_GREATER "5.9")
  if(CUDA_VERSION VERSION_GREATER_EQUAL "6.0")
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52]")
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52]")
  endif()
  endif()
  # Pascal (GPU Arch 6.x) is supported by CUDA 8 and later
  # Pascal (GPU Arch 6.x) is supported by CUDA 8 and later
  if(CUDA_VERSION VERSION_GREATER "7.9")
  if(CUDA_VERSION VERSION_GREATER_EQUAL "8.0")
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61]")
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61]")
  endif()
  endif()
  # Volta (GPU Arch 7.0) is supported by CUDA 9 and later
  # Volta (GPU Arch 7.0) is supported by CUDA 9 and later
  if(CUDA_VERSION VERSION_GREATER "8.9")
  if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0")
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_70,code=[sm_70,compute_70]")
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_70,code=[sm_70,compute_70]")
  endif()
  endif()
  # Turing (GPU Arch 7.5) is supported by CUDA 10 and later
  # Turing (GPU Arch 7.5) is supported by CUDA 10 and later
  if(CUDA_VERSION VERSION_GREATER "9.9")
  if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0")
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]")
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]")
  endif()
  endif()
  # Ampere (GPU Arch 8.0) is supported by CUDA 11 and later
  if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
    string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
  endif()
  if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
    message(WARNING "Unsupported CUDA version. Use at your own risk.")
  endif()


  cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC}
  cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC}
          -DUNIX -O3 --use_fast_math -Wno-deprecated-gpu-targets -DNV_KERNEL -DUCL_CUDADR ${GPU_CUDA_GENCODE} -D_${GPU_PREC_SETTING})
          -DUNIX -O3 --use_fast_math -Wno-deprecated-gpu-targets -DNV_KERNEL -DUCL_CUDADR ${GPU_CUDA_GENCODE} -D_${GPU_PREC_SETTING})
@@ -228,29 +239,40 @@ elseif(GPU_API STREQUAL "HIP")
    # --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
    # --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
    set(HIP_CUDA_GENCODE "-arch=${HIP_ARCH}")
    set(HIP_CUDA_GENCODE "-arch=${HIP_ARCH}")
    # Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0
    # Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0
    if((CUDA_VERSION VERSION_GREATER "3.1") AND (CUDA_VERSION VERSION_LESS "9.0"))
    if((CUDA_VERSION VERSION_GREATER_EQUAL "3.2") AND (CUDA_VERSION VERSION_LESS "9.0"))
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20]")
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20]")
    endif()
    endif()
    # Kepler (GPU Arch 3.x) is supported by CUDA 5 and later
    # Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2
    if(CUDA_VERSION VERSION_GREATER "4.9")
    if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0"))
      string(APPEND HIP_CUDA_GENCODE "-gencode arch=compute_30,code=[sm_30,compute_30] -gencode arch=compute_35,code=[sm_35,compute_35] ")
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30]")
    endif()
    # Kepler (GPU Arch 3.5) is supported by CUDA 5 to CUDA 11.0
    if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "12.0"))
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_35,code=[sm_35,compute_35]")
    endif()
    endif()
    # Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later
    # Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later
    if(CUDA_VERSION VERSION_GREATER "5.9")
    if(CUDA_VERSION VERSION_GREATER_EQUAL "6.0")
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52]")
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52]")
    endif()
    endif()
    # Pascal (GPU Arch 6.x) is supported by CUDA 8 and later
    # Pascal (GPU Arch 6.x) is supported by CUDA 8 and later
    if(CUDA_VERSION VERSION_GREATER "7.9")
    if(CUDA_VERSION VERSION_GREATER_EQUAL "8.0")
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61]")
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61]")
    endif()
    endif()
    # Volta (GPU Arch 7.0) is supported by CUDA 9 and later
    # Volta (GPU Arch 7.0) is supported by CUDA 9 and later
    if(CUDA_VERSION VERSION_GREATER "8.9")
    if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0")
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_70,code=[sm_70,compute_70]")
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_70,code=[sm_70,compute_70]")
    endif()
    endif()
    # Turing (GPU Arch 7.5) is supported by CUDA 10 and later
    # Turing (GPU Arch 7.5) is supported by CUDA 10 and later
    if(CUDA_VERSION VERSION_GREATER "9.9")
    if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0")
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]")
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]")
    endif()
    endif()
    # Ampere (GPU Arch 8.0) is supported by CUDA 11 and later
    if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
      string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
    endif()
    if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
      message(WARNING "Unsupported CUDA version. Use at your own risk.")
    endif()
  endif()
  endif()


  file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
  file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
+11 −2
Original line number Original line Diff line number Diff line
@@ -105,10 +105,10 @@ CMake build
                                # generic (default) or intel (Intel CPU) or fermi, kepler, cypress (NVIDIA)
                                # generic (default) or intel (Intel CPU) or fermi, kepler, cypress (NVIDIA)
   -D GPU_ARCH=value            # primary GPU hardware choice for GPU_API=cuda
   -D GPU_ARCH=value            # primary GPU hardware choice for GPU_API=cuda
                                # value = sm_XX, see below
                                # value = sm_XX, see below
                                # default is sm_30
                                # default is sm_50
   -D HIP_ARCH=value            # primary GPU hardware choice for GPU_API=hip
   -D HIP_ARCH=value            # primary GPU hardware choice for GPU_API=hip
                                # value depends on selected HIP_PLATFORM
                                # value depends on selected HIP_PLATFORM
                                # default is 'gfx906' for HIP_PLATFORM=hcc and 'sm_30' for HIP_PLATFORM=nvcc
                                # default is 'gfx906' for HIP_PLATFORM=hcc and 'sm_50' for HIP_PLATFORM=nvcc
   -D HIP_USE_DEVICE_SORT=value # enables GPU sorting
   -D HIP_USE_DEVICE_SORT=value # enables GPU sorting
                                # value = yes (default) or no
                                # value = yes (default) or no
   -D CUDPP_OPT=value           # optimization setting for GPU_API=cuda
   -D CUDPP_OPT=value           # optimization setting for GPU_API=cuda
@@ -1255,6 +1255,15 @@ also typically :ref:`install the USER-OMP package <user-omp>`, as it can be
used in tandem with the USER-INTEL package to good effect, as explained
used in tandem with the USER-INTEL package to good effect, as explained
on the :doc:`Speed intel <Speed_intel>` doc page.
on the :doc:`Speed intel <Speed_intel>` doc page.


When using Intel compilers version 16.0 or later is required.  You can
also use the GNU or Clang compilers and they will provide performance
improvements over regular styles and USER-OMP styles, but less so than
with the Intel compilers.  Please also note, that some compilers have
been found to apply memory alignment constraints incompletely or
incorrectly and thus can cause segmentation faults in otherwise correct
code when using features from the USER-INTEL package.


CMake build
CMake build
^^^^^^^^^^^
^^^^^^^^^^^


+2 −8
Original line number Original line Diff line number Diff line
@@ -46,13 +46,6 @@ An alphabetic list of all general LAMMPS commands.
   * :doc:`dimension <dimension>`
   * :doc:`dimension <dimension>`
   * :doc:`displace_atoms <displace_atoms>`
   * :doc:`displace_atoms <displace_atoms>`
   * :doc:`dump <dump>`
   * :doc:`dump <dump>`
   * :doc:`dump atom/adios <dump_adios>`
   * :doc:`dump custom/adios <dump_adios>`
   * :doc:`dump image <dump_image>`
   * :doc:`dump movie <dump_image>`
   * :doc:`dump netcdf <dump_netcdf>`
   * :doc:`dump netcdf/mpiio <dump_netcdf>`
   * :doc:`dump vtk <dump_vtk>`
   * :doc:`dump_modify <dump_modify>`
   * :doc:`dump_modify <dump_modify>`
   * :doc:`dynamical_matrix <dynamical_matrix>`
   * :doc:`dynamical_matrix <dynamical_matrix>`
   * :doc:`echo <echo>`
   * :doc:`echo <echo>`
@@ -108,7 +101,8 @@ An alphabetic list of all general LAMMPS commands.
   * :doc:`region <region>`
   * :doc:`region <region>`
   * :doc:`replicate <replicate>`
   * :doc:`replicate <replicate>`
   * :doc:`rerun <rerun>`
   * :doc:`rerun <rerun>`
   * :doc:`reset_ids <reset_ids>`
   * :doc:`reset_atom_ids <reset_atom_ids>`
   * :doc:`reset_mol_ids <reset_mol_ids>`
   * :doc:`reset_timestep <reset_timestep>`
   * :doc:`reset_timestep <reset_timestep>`
   * :doc:`restart <restart>`
   * :doc:`restart <restart>`
   * :doc:`run <run>`
   * :doc:`run <run>`
+2 −0
Original line number Original line Diff line number Diff line
@@ -80,6 +80,7 @@ KOKKOS, o = USER-OMP, t = OPT.
   * :doc:`ke/eff <compute_ke_eff>`
   * :doc:`ke/eff <compute_ke_eff>`
   * :doc:`ke/rigid <compute_ke_rigid>`
   * :doc:`ke/rigid <compute_ke_rigid>`
   * :doc:`mesont <compute_mesont>`
   * :doc:`mesont <compute_mesont>`
   * :doc:`mliap <compute_mliap>`
   * :doc:`momentum <compute_momentum>`
   * :doc:`momentum <compute_momentum>`
   * :doc:`msd <compute_msd>`
   * :doc:`msd <compute_msd>`
   * :doc:`msd/chunk <compute_msd_chunk>`
   * :doc:`msd/chunk <compute_msd_chunk>`
@@ -122,6 +123,7 @@ KOKKOS, o = USER-OMP, t = OPT.
   * :doc:`smd/tlsph/strain/rate <compute_smd_tlsph_strain_rate>`
   * :doc:`smd/tlsph/strain/rate <compute_smd_tlsph_strain_rate>`
   * :doc:`smd/tlsph/stress <compute_smd_tlsph_stress>`
   * :doc:`smd/tlsph/stress <compute_smd_tlsph_stress>`
   * :doc:`smd/triangle/vertices <compute_smd_triangle_vertices>`
   * :doc:`smd/triangle/vertices <compute_smd_triangle_vertices>`
   * :doc:`smd/ulsph/effm <compute_smd_ulsph_effm>`
   * :doc:`smd/ulsph/num/neighs <compute_smd_ulsph_num_neighs>`
   * :doc:`smd/ulsph/num/neighs <compute_smd_ulsph_num_neighs>`
   * :doc:`smd/ulsph/strain <compute_smd_ulsph_strain>`
   * :doc:`smd/ulsph/strain <compute_smd_ulsph_strain>`
   * :doc:`smd/ulsph/strain/rate <compute_smd_ulsph_strain_rate>`
   * :doc:`smd/ulsph/strain/rate <compute_smd_ulsph_strain_rate>`
Loading