use kokkos in lammps library

Dear all,

I wonder if kokkos is compatible with lammps library mode?
I tried to extract energy and forces using lammps_extract_variable, but all returned values are 0.
The code works well in non-kokkos mode.
Any ideas? Thank you in advance.

Zhiyao

Dear all,

I wonder if kokkos is compatible with lammps library mode?

there are no provisions for KOKKOS in the library interface. so for as
long as you are doing operations, that are compatible with normal
input scripts, it should function like a regular LAMMPS executable.
however, if you are modifying data directly, that needs to be managed
special with KOKKOS, then it is not likely to work.

I tried to extract energy and forces using lammps_extract_variable, but all returned values are 0.
The code works well in non-kokkos mode.

there is no special treatment of variables by KOKKOS and no KOKKOS
related operations in the lammps_extract_variable() function, so
reading of variables should work as well with the library interface
(or not) as in a standalone executable.

axel.

It might depend on what the variable you

are extracting calculates. When Kokkos is

run with GPUs, then some per-atom data lives

on the GPU, and just a copy on the CPU. If

the variable is using per-atom values, it would

only be accessing the CPU values. Which may

not be up to date with the GPU. In LAMMPS

runs, there is logic in the code to insure the

CPU and GPU values are in-sync when needed.

That logic may not be present when just accessing

a variable via a library method.

Stan (CCd) can probably comment.

Steve