LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Notes on porting pair styles to KOKKOS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] Notes on porting pair styles to KOKKOS

From: Steve Plimpton <sjplimp@...24...>
Date: Mon, 20 Nov 2017 10:52:33 -0700

Thanks Stefan, it sounds quite useful to have this doc
distributed with LAMMPS.  I'll let Stan answer the specific Qs.

I don't think the Kokkos folks have current plans to support
OpenCL.  I think they don't view it as having a strong future.


On Fri, Nov 17, 2017 at 12:14 PM, Stefan Paquay <stefanpaquay@...24...> wrote:
Hi all (and the kokkos folks in particular),

Today I ran into the fact that pair_yukawa was GPU-enabled but not KOKKOS-enabled, so I ported it, following the approach I followed for pair_morse.
This time, however, I was smart enough to write down notes about the porting process, which will probably be of use to anyone that is interested in porting pair styles to kokkos.

I have attached the notes here. I also ran into some questions, which I will put here:
  - Why does Pair*Kokkos check narg before calling Pair*::settings? This seems like a violation of Don't Repeat Yourself?
  - A lot of it is just boiler-plating and renaming. Can we template more?
    I know this will make compile times even worse but it will save a lot of copy paste errors. My C++ metaprogramming is not good enough to do this I think.
  - There is no factor_lj in compute_fpair/compute_evdwl. Are these applied later?
  - Which headers are really required? I just included everything pair_morse_kokkos.cpp also included, but it might be worth filtering out some.

I am thinking it would be useful to have this floating around the website as a tutorial, because I can imagine other people might want to take advantage of GPU acceleration for their pair styles. Although KOKKOS looks intimidating, it really is  mostly a copy-paste job...

I will file a pull request for pair_yukawa_kokkos.{cpp,h} later.

Hope this helps,

P.S.: Are there any plans to have KOKKOS target OpenCL in the future?

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
lammps-users mailing list