GPU acceleration issue: "Dihedral_style charmm/kk requires half neighbor list"

Hello everyone,

I am trying to run LAMMPS with GPU acceleration enabled via the KOKKOS package to do some long molecular dynamics simulations for a few organic molecules dispersed in a polymer matrix. As I failed miserably to build LAMMPS with GPU acceleration myself (some cmath header error that I could not figure out), I asked the HPC center staff to do it for me. And so they built the LAMMPS/29Aug2024 version (their choice).

I then proceeded to adapted the input script, which runs fine for CPU only jobs, by adding /kk in command lines related to the force field setup, which by the way is CGenFF (some "adapted CHARMM version for small organic molecules”). E.g. for now it is looking like this:

units real
atom_style full
boundary p p p

bond_style      harmonic/kk
angle_style     charmm/kk
dihedral_style  charmmfsw/kk
special_bonds   charmm
improper_style  harmonic/kk

pair_style lj/charmmfsw/coul/long/kk 10 12
pair_modify mix arithmetic
kspace_style pppm/kk 1e-6

read_data	Last_MS.data

(...)

I also tried adding /kk only to a subset of the above. Regardless, once I reach the run command, I always get the error:

ERROR: Dihedral_style charmm/kk requires half neighbor list (src/KOKKOS/dihedral_charmmfsw_kokkos.cpp:84)

I thought the default was to use half of the neighbor list? Does the default change because of the KOKKOS package? Does anyone know how I can fix that? :smiling_face_with_tear:

Best,
Cecilia

Yes, KOKKOS changes this setting, it’s documented here: package command — LAMMPS documentation

The best way of using KOKKOS is to add -sf kk -k on g {number_of_gpus_per_node} -pk kokkos neigh half switches to the command line. The first switch ensures that KOKKOS variant is used for all commands that supports it, which is crucial for performance. The second switch activates KOKKOS and requests how many GPUs per (physical) node will be used, and the last one is changing the neighbor list back to half.

2 Likes

Ahhh, thank you so much ! I had not come across this page you linked. Now it works :grimacing: