maintainability and performance for lammps
play

Maintainability and Performance for LAMMPS Chris8an Tro: , - PowerPoint PPT Presentation

Photos placed in horizontal position with even amount of white space between photos and header Maintainability and Performance for LAMMPS Chris8an Tro: , Tzu-Ray Shan, Stan Moore, Aidan


  1. Photos placed in horizontal position with even amount of white space between photos and header Maintainability ¡and ¡Performance ¡for ¡LAMMPS ¡ ¡ Chris8an ¡Tro: , ¡Tzu-­‑Ray ¡Shan, ¡Stan ¡Moore, ¡Aidan ¡Thompson ¡and ¡Steve ¡Plimpton ¡ Center ¡for ¡Compu,ng ¡Research; ¡Sandia ¡Na,onal ¡Laboratories ¡ ¡ SAND2015-­‑10209 ¡C ¡ Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation, for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000. SAND NO. 2011-XXXXP

  2. LAMMPS ¡a ¡general ¡purpose ¡MD ¡code ¡ § C++, ¡MPI ¡based ¡open ¡source ¡code: ¡lammps.sandia.gov ¡ § Modular ¡design ¡for ¡easy ¡extensibility ¡by ¡expert ¡users ¡ § Wide ¡variety ¡of ¡supported ¡parNcle ¡physics: ¡ § Bio ¡simulaNons, ¡semi ¡conductors, ¡metals, ¡granular ¡materials ¡ § E.g. ¡blood ¡transport, ¡strain ¡simulaNons, ¡grain ¡flow, ¡glass ¡forming, ¡self ¡ assembly ¡of ¡nano ¡materials, ¡neutron ¡star ¡maSer ¡ § Large ¡flexibility ¡in ¡system ¡constrains ¡ § Regions, ¡walls, ¡geometric ¡shapes, ¡external ¡forces, ¡parNcle ¡injecNon, ¡… ¡ § Scalable: ¡simulaNons ¡with ¡up ¡to ¡6 ¡Million ¡MPI ¡ranks ¡ demonstrated ¡ 2 ¡

  3. LAMMPS ¡a ¡general ¡purpose ¡MD ¡code ¡ § C++, ¡MPI ¡based ¡open ¡source ¡code: ¡lammps.sandia.gov ¡ § Modular ¡design ¡for ¡easy ¡extensibility ¡by ¡expert ¡users ¡ § Wide ¡variety ¡of ¡supported ¡parNcle ¡physics: ¡ § Bio ¡simulaNons, ¡semi ¡conductors, ¡metals, ¡granular ¡materials ¡ § E.g. ¡blood ¡transport, ¡strain ¡simulaNons, ¡grain ¡flow, ¡glass ¡forming, ¡self ¡ assembly ¡of ¡nano ¡materials, ¡neutron ¡star ¡maSer ¡ § Large ¡flexibility ¡in ¡system ¡constrains ¡ § Regions, ¡walls, ¡geometric ¡shapes, ¡external ¡forces, ¡parNcle ¡injecNon, ¡… ¡ § Scalable: ¡simulaNons ¡with ¡up ¡to ¡6 ¡Million ¡MPI ¡ranks ¡ demonstrated ¡ Estimate: 500 Performance Critical Kernels 3 ¡

  4. LAMMPS ¡on ¡next ¡generaNon ¡plaYorms ¡ § Next ¡generaNon ¡plaYorm ¡support ¡through ¡packages ¡ § GPU ¡ § GPU ¡support ¡for ¡NVIDIA ¡Cuda ¡and ¡OpenCL ¡since ¡2011 ¡ § Offloads ¡force ¡calculaNons ¡(non-­‑bonded, ¡long ¡range ¡coulomb) ¡ § USER-­‑CUDA ¡ § GPU ¡support ¡for ¡NVIDIA ¡Cuda ¡ § Aims ¡at ¡minimizing ¡data ¡transfer ¡=> ¡run ¡everything ¡on ¡GPU ¡ § Reverse ¡offload ¡for ¡long ¡range ¡coulomb ¡and ¡bonded ¡interacNon ¡ § OMP ¡ § OpenMP ¡3 ¡support ¡for ¡mulN ¡threading ¡ § Aimed ¡at ¡low ¡thread ¡count ¡(2-­‑8) ¡ § INTEL ¡ § Intel ¡Offload ¡pragmas ¡for ¡Xeon ¡Phi ¡ § Offloads ¡force ¡calculaNons ¡(non-­‑bonded, ¡long ¡range ¡coulomb) ¡ 4 ¡

  5. LAMMPS ¡on ¡next ¡generaNon ¡plaYorms ¡ § Next ¡generaNon ¡plaYorm ¡support ¡through ¡packages ¡ § GPU ¡ § GPU ¡support ¡for ¡NVIDIA ¡Cuda ¡and ¡OpenCL ¡since ¡2011 ¡ Packages replicate existing physics § Offloads ¡force ¡calculaNons ¡(non-­‑bonded, ¡long ¡range ¡coulomb) ¡ modules: § USER-­‑CUDA ¡ § GPU ¡support ¡for ¡NVIDIA ¡Cuda ¡ § Aims ¡at ¡minimizing ¡data ¡transfer ¡=> ¡run ¡everything ¡on ¡GPU ¡ Hard to maintain. § Reverse ¡offload ¡for ¡long ¡range ¡coulomb ¡and ¡bonded ¡interacNon ¡ § OMP ¡ Prone to inconsistencies. § OpenMP ¡3 ¡support ¡for ¡mulN ¡threading ¡ Much more code. § Aimed ¡at ¡low ¡thread ¡count ¡(2-­‑8) ¡ § INTEL ¡ § Intel ¡Offload ¡pragmas ¡for ¡Xeon ¡Phi ¡ § Offloads ¡force ¡calculaNons ¡(non-­‑bonded, ¡long ¡range ¡coulomb) ¡ 5 ¡

  6. Kokkos: ¡ Performance, ¡Portability ¡and ¡Produc,vity ¡ LAMMPS# Trilinos# Albany# Kokkos# HBM# HBM# HBM# HBM# DDR# DDR# DDR# DDR# DDR# 6 ¡

  7. Kokkos: ¡ Performance, ¡Portability ¡and ¡Produc,vity ¡ § A ¡programming ¡model ¡implemented ¡as ¡a ¡C++ ¡library ¡ § Open ¡Source ¡(BSD): ¡hSps://github.com/kokkos ¡ ¡ § Code, ¡Tutorials ¡(200+ ¡Slides), ¡Programming ¡Guide ¡(65 ¡Pages) ¡ § AbstracNons ¡for ¡Parallel ¡ExecuNon ¡and ¡Data ¡Management ¡ § ExecuNon ¡PaSern: ¡What ¡kind ¡of ¡operaNon ¡(for-­‑each, ¡reducNon, ¡scan) ¡ § ExecuNon ¡Policy: ¡How ¡to ¡execute ¡(Range ¡Policy, ¡Team ¡Policy, ¡DAG) ¡ § ExecuNon ¡Space: ¡Where ¡to ¡execute ¡(GPU, ¡Host ¡Threads, ¡PIM) ¡ § Memory ¡Layout: ¡ ¡ § Memory ¡Traits: ¡How ¡to ¡access ¡the ¡data ¡(Random, ¡Stream, ¡Atomic) ¡ § Memory ¡Space: ¡Where ¡does ¡the ¡data ¡live ¡(High ¡Bandwidth, ¡DDR, ¡NV) ¡ § Supports ¡mulNple ¡backends: ¡OpenMP, ¡Pthreads, ¡Cuda, ¡ Qthreads, ¡Kalmar ¡(experimental) ¡ § Sandia ¡applicaNon ¡teams ¡commiSed ¡to ¡Kokkos ¡as ¡its ¡path ¡for ¡ transiNoning ¡legacy ¡codes, ¡and ¡as ¡part ¡of ¡its ¡new ¡codes ¡ § Trilinos, ¡LAMMPS, ¡Albany, ¡Sierra ¡Mechanics, ¡… ¡ ¡ 7 ¡

  8. Kokkos ¡in ¡LAMMPS: ¡Examples ¡I ¡ template<class ExecSpace> � struct IntegratNVE { � Kokkos::View<double*[3],ExecSpace::memory_space> x,f,v; � Kokkos::View<const double*[3],ExecSpace::memory_space> c_x,c_f,c_v; � double dt; � int natoms; � � void initial_integrate() { � Kokkos::parallel_for( � Kokkos::RangePolicy<ExecSpace, InitialIntegrate>(natoms), � *this); � } � � KOKKOS_INLINE_FUNCTION � void operator() (InitialIntegrate , const int i) const { � v(i,0) *= dt*c_f(i,0); � v(i,1) *= dt*c_f(i,1); � v(i,2) *= dt*c_f(i,2); � } � }; � 8 ¡

  9. Kokkos ¡in ¡LAMMPS: ¡Examples ¡I ¡ template<class ExecSpace> � struct IntegratNVE { � Kokkos::View<double*[3],ExecSpace::memory_space> x,f,v; � Kokkos::View<const double*[3],ExecSpace::memory_space> c_x,c_f,c_v; � double dt; � int natoms; � Template Modules on Execution Space: e.g. Cuda, OpenMP � void initial_integrate() { � Kokkos::parallel_for( � Kokkos::RangePolicy<ExecSpace, InitialIntegrate>(natoms), � *this); � } � � KOKKOS_INLINE_FUNCTION � void operator() (InitialIntegrate , const int i) const { � v(i,0) *= dt*c_f(i,0); � v(i,1) *= dt*c_f(i,1); � v(i,2) *= dt*c_f(i,2); � } � }; � 9 ¡

  10. Kokkos ¡in ¡LAMMPS: ¡Examples ¡I ¡ template<class ExecSpace> � struct IntegratNVE { � Kokkos::View<double*[3],ExecSpace::memory_space> x,f,v; � Kokkos::View<const double*[3],ExecSpace::memory_space> c_x,c_f,c_v; � double dt; � int natoms; � � void initial_integrate() { � Kokkos::parallel_for( � Kokkos::RangePolicy<ExecSpace, InitialIntegrate>(natoms), � *this); � } � � KOKKOS_INLINE_FUNCTION � void operator() (InitialIntegrate , const int i) const { � v(i,0) *= dt*c_f(i,0); � v(i,1) *= dt*c_f(i,1); � v(i,2) *= dt*c_f(i,2); � } � }; � 10 ¡

  11. Kokkos ¡in ¡LAMMPS: ¡Examples ¡I ¡ template<class ExecSpace> � Kokkos Multidimensional View struct IntegratNVE { � Kokkos::View<double*[3],ExecSpace::memory_space> x,f,v; � Kokkos::View<const double*[3],ExecSpace::memory_space> c_x,c_f,c_v; � double dt; � int natoms; � � void initial_integrate() { � Kokkos::parallel_for( � Kokkos::RangePolicy<ExecSpace, InitialIntegrate>(natoms), � *this); � } � � KOKKOS_INLINE_FUNCTION � void operator() (InitialIntegrate , const int i) const { � v(i,0) *= dt*c_f(i,0); � v(i,1) *= dt*c_f(i,1); � v(i,2) *= dt*c_f(i,2); � } � }; � 11 ¡

  12. Kokkos ¡in ¡LAMMPS: ¡Examples ¡I ¡ template<class ExecSpace> � struct IntegratNVE { � Kokkos::View<double*[3],ExecSpace::memory_space> x,f,v; � Kokkos::View<const double*[3],ExecSpace::memory_space> c_x,c_f,c_v; � double dt; � int natoms; � � void initial_integrate() { � Kokkos::parallel_for( � Kokkos::RangePolicy<ExecSpace, InitialIntegrate>(natoms), � *this); � } � � KOKKOS_INLINE_FUNCTION � void operator() (InitialIntegrate , const int i) const { � v(i,0) *= dt*c_f(i,0); � v(i,1) *= dt*c_f(i,1); � v(i,2) *= dt*c_f(i,2); � } � }; � 12 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend