I want to use the reaxff force field in lamps to perform molecular dynamics simulations. My system is relatively simple, which is the reaction of toluene, oxygen and carbon monoxide at high temperatures. However, this reaction is very slow when using the CPU to perform parallel calculations, so I thought about using kokkos and cuda for gpu acceleration. My in file is as follows:
units real ##fs Å
boundary p p p
atom_style full
read_data 10_0_11_0_11.data
pair_style reaxff NULL safezone 4.0 mincap 100
pair_coeff * * CHO.ff C H O
fix 1 all qeq/reaxff 1 0.0 10.0 1.0e-6 reaxff
neighbor 2.0 bin
neigh_modify every 1 delay 0 check yes
minimize 1e-10 1e-10 10000 10000
fix 11 all nve
fix 22 all temp/berendsen 2500 2500 500
fix 5 all reaxff/species 1 100 100 species.out element C H O
fix 6 all reaxff/bonds 1000 bonds.reaxc
timestep 0.10
thermo_style custom step time temp etotal pe ke density press
thermo 100
dump 2 all custom 500 mydump-nvt.lammpstrj id mol type x y z q
dump xtcout all xtc 100 myxtc-nvt.xtc
run 100000000
restart 1000000 restart.equil
write_restart restart_.equil1
The command to use is:
lmp -in in.NVT -k on g 1 -sf kk -pk kokkos neigh half newton on
At this time, the calculation can still run normally, but it prompts me that I cannot use kokkos for acceleration due to fix-related issues. The specific error reported is as follows:
WARNING: Fix with atom-based arrays not compatible with sending data in Kokkos communication, switching to classic exchange/border communication (src/KOKKOS/comm_kokkos.cpp:666)
WARNING: Fix with atom-based arrays not compatible with Kokkos sorting on device, switching to classic host sorting (src/KOKKOS/atom_kokkos.cpp:178)
This gives me a headache, because these fix commands are the core steps of my calculations. I hope you can give me some suggestions to help me use kokkos normally.
First of all, I apologize for my incomplete expression before. The additional information is as follows:
My system is ubuntu22.04;
My lamps is lamps-2Aug2023, and the kokkos in it was replaced with version 4.1;
My graphics card is Titan V.
The in file I showed above is the file I used before when using pure CPU calculations.
My problem is mainly that I encountered problems when using kokkos for gpu acceleration using the previous in file, and could not correctly enable the acceleration effect of kokkos. In fact, the running result is relatively slow.
I want to see if I can correctly use kokkos for gpu acceleration by modifying the in file to obtain higher performance than pure CPU.
Thanks for your answer.
There is no Kokkos version of fix temp/berendsen so that will slow down the simulation. Can you use a different thermostat like fix langevin or fix nvt which has Kokkos support?
Also, how many atoms are in the system? Typically you need hundreds of thousands to a million (more is better) per GPU to start saturating the GPU.
I have meet the same problem. However, after removing all fix command(except fix npt), the warning message still appears and the time consumed are still long. Where can i found the supported fix command by kokkos. thanks very much.
warning message still appears and the time consumed are still long.
Sometimes LAMMPS creates its own internal fixes. Can you try running again with the latest version of LAMMPS? It has more detailed output of the fix name (thanks @alphataubio!).
Depending on your GPU the overhead may not be that bad.