Problem with KOKKOS package

Dear Christian,

I am writing to you about KOKKOS package in LAMMPS.
I succesfully compiled CUDA version of KOKKOS and it runs well with simple lj script. However, segmentation fault error occurs when I try to run SPC/E water bench script from LAMMPS site (http://lammps.sandia.gov/bench/bench_spce.tar.gz):

./lmp_kokkos_cuda -k on g 1 t 1 -sf kk -pk kokkos -in in.spce

LAMMPS (5 Nov 2014)
KOKKOS mode is enabled (…/lammps.cpp:489)
using 1 OpenMP thread(s) per MPI task
Reading data file …
orthogonal box = (0.02645 0.02645 0.02641) to (35.5328 35.5328 35.4736)
1 by 1 by 1 MPI processor grid
reading atoms …
4500 atoms
scanning bonds …
2 = max bonds/atom
scanning angles …
1 = max angles/atom
reading bonds …
3000 bonds
reading angles …
1500 angles
Finding 1-2 1-3 1-4 neighbors …
2 = max # of 1-2 neighbors
1 = max # of 1-3 neighbors
Segmentation Fault (core dumped)

gdb says that the error appears in line 965 of special.cpp file, that is problem connected with nspecial array.
Possibly, there is a bug in the KOKKOS package, because the same script works on the CPU as well as with USER-CUDA and GPU packages.

Sincerely yours,
Grigory Smirnov

Stan - have you run this test in your regression suite?

Steve

​Hi

this is a bug. Th problem is that special reallocates atom->special directly instead of asking the atom class to reallocate it.

That is a problem since the atom->special was allocated through the kokkos allocation mechanism (i.e. a dual view was created and the classic atom->special array points to that). This needs to be fixed by putting a way in that the atom class can be asked to reallocate that array.

Btw. Steve I found an issue in the atom_vec*kokkos styles: in a number of places the deep copy thing does something like: (mask && DATA_MASK) where it should be (mask & DATA_MASK).

Christian

I previously ran Kokkos through the regression suite and found several such bugs. Keep in mind that only a small fraction of LAMMPS has been ported over to Kokkos, so it doesn’t really make sense to run SPC/E benchmark problem yet (i.e. much of it will just run on the host right now) unless you are looking for bugs. This is still very much a work in progress.

Stan

Btw. Steve I found an issue in the atom_vec*kokkos styles: in a number of places the deep copy thing does something >like: (mask && DATA_MASK) where it should be (mask & DATA_MASK).

Fixed this one …

Steve