Particle Simulations with HOOMD-blue Joshua A. Anderson S6256 - - PowerPoint PPT Presentation

particle simulations with hoomd blue
SMART_READER_LITE
LIVE PREVIEW

Particle Simulations with HOOMD-blue Joshua A. Anderson S6256 - - PowerPoint PPT Presentation

Particle Simulations with HOOMD-blue Joshua A. Anderson S6256 NVIDIA GTC April 7, 2016 9:00-9:50am T HE G LOTZER G ROUP HOOMD-blue General purpose particle simulation toolkit Molecular dynamics, hard particle Monte Carlo Executes


slide-1
SLIDE 1

THE GLOTZER GROUP

Particle Simulations with HOOMD-blue

Joshua A. Anderson

NVIDIA GTC April 7, 2016 9:00-9:50am

S6256

slide-2
SLIDE 2

THE GLOTZER GROUP

HOOMD-blue

General purpose particle simulation toolkit Molecular dynamics, hard particle Monte Carlo Executes simulations fast on GPUs (also runs on CPUs) Open source >127 peer-reviewed articles

2

slide-3
SLIDE 3

THE GLOTZER GROUP

History

2007-02 - CUDA public beta 2007-03 - APS March meeting 2007-09 - Paper submitted 2008-02 - v0.6: C++ benchmarks

  • nly, lj and harmonic bonds only

2008-08 - v0.7: Python job scripts 2008-12 - v0.8: First external contribution - FENE bonds, Langevin dynamics

3

slide-4
SLIDE 4

THE GLOTZER GROUP

History

2015-09 - v1.2: Bounding volume hierarchy neighbor list 2015-12 - v1.3: Anisotropic particle integrators, wall potentials, load balancing 2016-?? - v2.0: Hard particle Monte Carlo

4

slide-5
SLIDE 5

THE GLOTZER GROUP

Research using HOOMD

5

Quasicrystal formation Microspheres Shape allophiles Active particles Digital alchemy Hexatic phases

slide-6
SLIDE 6

THE GLOTZER GROUP

Molecular dynamics

6

~ ri(t) ~ !i(t) ~ vi(t) ~ qi(t) ~ qi(t + t) ~ vi(t + t) ~ !i(t + t) ~ ri(t + t)

Compute interactions

slide-7
SLIDE 7

THE GLOTZER GROUP

Hard particle Monte Carlo (HPMC)

7

~ ri(A) ~ qi(A) ~ qi(B) ~ ri(B)

Random trial move Accept or reject

Joshua A Anderson, M Eric Irrgang, Sharon C Glotzer (2016) Scalable Metropolis Monte Carlo for simulation of hard shapes, Computer Physics Communications

slide-8
SLIDE 8

THE GLOTZER GROUP

HPMC Shape overlap checks

8

+ See GTC 2014 talk

slide-9
SLIDE 9

THE GLOTZER GROUP

HPMC block level queue

9

(a) (b) Time (0.5 ms total) Thread

Initialization Trial move Circumsphere check Overlap check Overlap divergence Early exit divergence

Time

slide-10
SLIDE 10

THE GLOTZER GROUP

HPMC on P100

10

slide-11
SLIDE 11

THE GLOTZER GROUP

GPU strategy in HOOMD

Perform all computations on the GPU (see GTC 2010-2013 talks) Keep data on the GPU all the time Run multiple threads per particle and warp-level reduction/scan Auto-tune launch parameters during run time (see GTC 2015 talk)

11

slide-12
SLIDE 12

THE GLOTZER GROUP

Architecture

12

HOOMD python library HOOMD C++ library CUDA MPI Hardware User's python script matplotlib scipy mpi4py ...

slide-13
SLIDE 13

THE GLOTZER GROUP

Installing binaries with conda

13

http://conda.pydata.org/miniconda.html

slide-14
SLIDE 14

THE GLOTZER GROUP

Compile from source Requirements: C++ compiler Python Numpy Boost C++ library CMake Optional: CUDA MPI git sphinx

14

slide-15
SLIDE 15

THE GLOTZER GROUP

Compile from source

15

slide-16
SLIDE 16

THE GLOTZER GROUP

Example: DPD polymers

16

import hoomd from hoomd import md hoomd.context.initialize(); hoomd.init.read_gsd(filename='polymers.gsd') nl = hoomd.md.nlist.cell() dpd = md.pair.dpd(r_cut=1.0, T=1.0, nlist=nl) nl.reset_exclusions() dpd.pair_coeff.set('A', 'A', A=25.0, gamma = 4.5) dpd.pair_coeff.set('A', 'B', A=80.0, gamma = 4.5) dpd.pair_coeff.set('B', 'B', A=25.0, gamma = 4.5) harmonic = hoomd.md.bond.harmonic() harmonic.bond_coeff.set('polymer', k=330.0, r0=0.84) md.integrate.mode_standard(dt=0.02) md.integrate.nve(group=hoomd.group.all()) hoomd.run(10000)

slide-17
SLIDE 17

THE GLOTZER GROUP

Running the example

17

slide-18
SLIDE 18

THE GLOTZER GROUP

slide-19
SLIDE 19

THE GLOTZER GROUP

Example: Active matter

19

import hoomd, numpy from hoomd import md hoomd.context.initialize() hoomd.init.read_gsd('active.gsd') all = hoomd.group.all() N = len(all) nl = hoomd.md.nlist.cell() lj = md.pair.lj(r_cut=1.0, nlist=nl) lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0/2**(1.0/6.0)) activity = [ (((numpy.random.rand(3)

  • 0.5) * 2.0)) for i in range(N)]

for i in range(N): activity[i][2] = 0; activity[i] = tuple(activity[i]) active_force = md.force.active(group=all, seed=123, f_lst=activity, rotation_diff=0.005,

  • rientation_link=False)

md.integrate.mode_standard(dt=0.001) bd = md.integrate.brownian(group=all, T=0.0, seed=123, dscale=1.0) hoomd.run(100000)

slide-20
SLIDE 20

THE GLOTZER GROUP

20

slide-21
SLIDE 21

THE GLOTZER GROUP

BVH tree overview BVH trees are common in ray tracing HOOMD uses them for neighbor searches (optional) Generate and query

  • n the GPU

21

  • M. P. Howard, J. A. Anderson, A. Nikoubashman, S. C. Glotzer, and A. Z.

Panagiotopoulos, Comput. Phys. Commun., Mar. 2016.

slide-22
SLIDE 22

THE GLOTZER GROUP

Example: Large and small particles

22

import hoomd, numpy from hoomd import md hoomd.context.initialize() hoomd.init.read_gsd('bigsmall.gsd') nl = md.nlist.tree() lj = md.pair.slj(r_cut=2**(1.0/6.0), nlist=nl) lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0) md.integrate.mode_standard(dt=0.005) lvn = md.integrate.langevin(group=hoomd.group.all(), T=1.0, seed=123) lvn.set_gamma('A', 1.0) hoomd.run(3000000)

slide-23
SLIDE 23

THE GLOTZER GROUP

23

slide-24
SLIDE 24

THE GLOTZER GROUP

Example: Hard Hexagons

24

import hoomd from hoomd import hpmc hoomd.context.initialize(); hoomd.init.read_gsd(filename='hexagons.gsd') hexagon = [[0.5,0], [0.25,0.433012701892219], [-0.25,0.433012701892219], [-0.5,0], [-0.25,-0.433012701892219], [0.25,-0.433012701892219]]; mc = hpmc.integrate.convex_polygon(seed=123, d=0.15, a=1); mc.shape_param.set('A', vertices=hexagon); hoomd.run(200)

slide-25
SLIDE 25

THE GLOTZER GROUP

25

slide-26
SLIDE 26

THE GLOTZER GROUP

Example: Jupyter notebook

26

slide-27
SLIDE 27

THE GLOTZER GROUP

Additional features

  • Integration: NVE, NVT, NPT, NPH, langevin, brownian,

Berendsen, DPD, FIRE minimization

  • Orientational degrees of freedom
  • Pair potentials: CGCMM, DPD, LJ, Gaussian, Mie,

Moliere, Morse, Yukawa, ZBL, table

  • Bond: FENE, Harmonic, table, OPLS
  • Anisotropic potentials: Gay-berne, dipole
  • Wall potentials
  • PPPM electrostatics
  • HPMC shapes: convex polygon, simple polygon,

convex spheropolygon, convex polyhedron, convex spheropolyhedron, general polyhedron, ellipsoid, differences of spheres, unions of spheres, faceted spheres

27

slide-28
SLIDE 28

THE GLOTZER GROUP

Software engineering

28

Object oriented design Template functors Code review / pull requests Unit testing Validation testing Conda recipes Read the docs

slide-29
SLIDE 29

THE GLOTZER GROUP

slide-30
SLIDE 30

THE GLOTZER GROUP

slide-31
SLIDE 31

THE GLOTZER GROUP

Read The Docs

31

slide-32
SLIDE 32

THE GLOTZER GROUP

Acknowledgements

HOOMD-blue + HPMC:

codeblue.umich.edu/hoomd-blue/

2.0 will be available soon..... Thanks to all HOOMD-blue users and contributors! Research supported by the National Science Foundation, Division of Materials Research Award # DMR 1409620.

32