10
Formulation of an algorithm to Formulation of an algorithm to implement implement Lowe-Andersen thermostat in Lowe-Andersen thermostat in parallel molecular simulation package, parallel molecular simulation package, LAMMPS LAMMPS Prathyusha K. R. and P. B. Sunil Kumar Complex Fluids and Biological Physics Lab Department of Physics IIT Madras

Formulation of an algorithm to implement Lowe-Andersen thermostat in parallel molecular simulation package, LAMMPS Prathyusha K. R. and P. B. Sunil Kumar

Embed Size (px)

Citation preview

Page 1: Formulation of an algorithm to implement Lowe-Andersen thermostat in parallel molecular simulation package, LAMMPS Prathyusha K. R. and P. B. Sunil Kumar

Formulation of an algorithm to Formulation of an algorithm to implement implement

Lowe-Andersen thermostat inLowe-Andersen thermostat inparallel molecular simulation package, parallel molecular simulation package,

LAMMPSLAMMPS

Prathyusha K. R. and P. B. Sunil KumarComplex Fluids and Biological Physics Lab

Department of PhysicsIIT Madras

Page 2: Formulation of an algorithm to implement Lowe-Andersen thermostat in parallel molecular simulation package, LAMMPS Prathyusha K. R. and P. B. Sunil Kumar

Introduction

Molecular Dynamic (MD) Simulation solves Newton’s equations of motion

Microcanonical NVE ensemble

NVT is more realistic than an NVE ensemble:

Various thermostat used in MD simulations:

Nose-Hoover thermostat

Andersen thermostat

Stochastic Dynamics thermostat

Dissipative Particle Dynamics thermostat

Lowe-Andersen thermostat

Page 3: Formulation of an algorithm to implement Lowe-Andersen thermostat in parallel molecular simulation package, LAMMPS Prathyusha K. R. and P. B. Sunil Kumar

Lowe-Andersen thermostat (LAT)

A thermostat with momentum conservation

Simulates a wide-range of Schmidt number,

Kinematic viscosityDiffusion coefficient

For water,

Method

Step 1: Solve for positions and velocities of particles at

Step 2: For all pairs of particles within

(zero mean and unit variance)

i. Generate a relative velocity from a distribution

ii.

iii. and

with a probability C. P. Lowe, Europhys. Lett. 47, 145 (1999)

Page 4: Formulation of an algorithm to implement Lowe-Andersen thermostat in parallel molecular simulation package, LAMMPS Prathyusha K. R. and P. B. Sunil Kumar

Single CPU simulation

Soft beads in a box of size: 15x15x15Number density:Time step:

Co-ordinates of particle

Elements of stress tensor

Volume of the box

To simulate millions of particles: LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator)

S. Plimpton, J Comp Phys, 117, 1 (1995)

( http://lammps.sandia.gov/ )

runs on a single processor or in parallel

distributed-memory message-passing parallelism (MPI)

spatial-decomposition of simulation domain for parallelism

Page 5: Formulation of an algorithm to implement Lowe-Andersen thermostat in parallel molecular simulation package, LAMMPS Prathyusha K. R. and P. B. Sunil Kumar

Domain 1.

Domain 3. Domain 4.

Domain 2.Parallelization of LAT

Spatial decomposition assign particle to each domain

Each processor update position, velocities and compute forces

Communication scheme for particles in nearby boxes

Ghost particles particles which aren’t part of a domain but interacting with that domain. Parallelization of LAT is difficult due to the pair update of

velocity☞ This update scheme requires the velocity of neighbor particles ☞ Processors should know the updated velocity of particle at the

instant.☞ A processor a priori don’t know a particle at the boundary is

involved in collision☞ Velocity has to be communicated every time, when there is a

collision between particles. It is computationally expensive!

Page 6: Formulation of an algorithm to implement Lowe-Andersen thermostat in parallel molecular simulation package, LAMMPS Prathyusha K. R. and P. B. Sunil Kumar

A modified algorithm for LAT

Communicate and update velocity after few collision events

Pick up no. of pairs randomly for collision

No. of boundary particles

This ensure that is uniformly distributed within each domain

Velocity is updated using the LAT Eqn.

The parameter that controls :

(no. of communication at given

time step)

The mapping between original LAT:

( Total no. of pairs in

each domain)

The parameter that defines the probability

K. R. Prathyusha et al., Proceedings of the ATIP/A*CRC workshop-2012, 124 (2012)

Page 7: Formulation of an algorithm to implement Lowe-Andersen thermostat in parallel molecular simulation package, LAMMPS Prathyusha K. R. and P. B. Sunil Kumar

Validating LAT parallel algorithm

Soft beads in a box of size: 15x15x15

does not change with the number of processors for given

The relation between and

The relationship between

(original LAT) and : linear

(No. of processor used 16)

K. R. Prathyusha et al., Proceedings of the ATIP/A*CRC workshop-2012, 124 (2012)

Page 8: Formulation of an algorithm to implement Lowe-Andersen thermostat in parallel molecular simulation package, LAMMPS Prathyusha K. R. and P. B. Sunil Kumar

Benchmarking of LAT parallel algorithm

Soft beads with Box of size: 40x40x40Time step: Time taken for 10000 steps

K. R. Prathyusha et al., Proceedings of the ATIP/A*CRC workshop-2012, 124 (2012)

Page 9: Formulation of an algorithm to implement Lowe-Andersen thermostat in parallel molecular simulation package, LAMMPS Prathyusha K. R. and P. B. Sunil Kumar

Polymer Dynamics Simulations

Few applications of modified LAT

Living Polymer Simulations

K. R. Prathyusha et al., Proceedings of the ATIP/A*CRC workshop-2012, 124 (2012)

Page 10: Formulation of an algorithm to implement Lowe-Andersen thermostat in parallel molecular simulation package, LAMMPS Prathyusha K. R. and P. B. Sunil Kumar

Conclusions

A parallel version of Lowe-Andersen thermostat was developed

Its suitability by comparing the original serial version

with the modified parallel version, is validated

Viscosity parameter in the original and modified versions of LAT

exhibit linear relation

The algorithm is shown to exhibit good scaling

with the number of processors

Acknowledgments

HPCE, at IIT Madras

Thank you for your attention