Use Kokkos with dihedral style hydrid multi/harmonic opls?

I am trying to simulate an organic liquid with 10k atoms based on OPLS-AA using LAMMPS on a NVIDIA Tesla V100 GPU node with 24 CPUs.

I compile LAMMPS with KOKKOS package using the following command

cmake  -C ../cmake/presets/kokkos-cuda.cmake \
 -C ../cmake/presets/basic.cmake \
 -D BUILD_MPI=yes -D PKG_OPENMP=yes \
 -D Kokkos_ARCH_PASCAL60=no -D Kokkos_ARCH_VOLTA70=yes \
 -D Kokkos_ENABLE_OPENMP=yes -D PKG_MOLECULE=ON \ 
 -D PKG_COMPRESS=ON -D PKG_KSPACE=ON

and to run I use this command

export OMP_PROC_BIND=spread
export OMP_PLACES=threads
export OMP_NUM_THREADS=12
export MPI_NUM=2
mpirun -np $MPI_NUM /home/ji39tip/lammps-kokkos/build/lmp \
-in run.in -k on g 2 -sf kk -pk kokkos t $OMP_NUM

The problematic input line in run.in is

dihedral_style hybrid multi/harmonic opls

It leads to this error

ERROR: Must use only Kokkos-enabled dihedral styles 
with dihedral_style hybrid/kk (src/KOKKOS/dihedral_hybrid_kokkos.cpp:205)

Is it possible to use styles from different packages at the same time ? Does it lead to a good performance ?

Reading more through the documentation, I thought that using only the Kokkos suffix with -sf kk and in addition omitting it only for the problematic line would be implemented as

suffix off
dihedral_style hybrid multi/harmonic opls
suffix on

Many thanks for the feedback

Hi @YoussefMabrouk,

If this is direct a copy from your output, there may be an error in your input file.

fulf is not a valid LAMMPS atom style. I guess this is a typo.

Hi Germain, thanks for commenting. That was a mistake with copy-pasting the error, sorry for that. I corrected this now.

You can see what dihedral styles support the KOKKOS package here:

https://docs.lammps.org/Commands_bond.html#dihedral-styles

As you can see, there is no KOKKOS support for multi/harmonic.

Using only the Kokkos suffix in the run command with -sf kk and omitting it for the problematic line as

suffix off
dihedral_style hybrid multi/harmonic opls
suffix on

finally worked, but I am very doubtful about it as performance is degrading compared to LAMMPS compiled with the GPU package. Is this the right way to use multi/harmonic combined with KOKKOS ?

If you’re worried a bout performance, note that multi/harmonic formulation can be converted to OPLS formalism. This is a well known problem and has been documented for example in GROMACS documentation (see eq 201 and around).

This should allow you to use only OPLS style which is KOKKOS accelerated.