About hybrid method for md simulations.

Dear Lammps authors

I am wondering why lammps didn’t employ method for its parallization, i.e., using openmp and openmpi at the same time? Since it is not very hard to implement change openmp into the code and lammps don’t have openmp, did that mean the hybrid method didn’t have much advantage with one-level openmpi method? Thanks very much!

Best!

Hao

Have you checked out the USER-OMP package? LAMMPS has many different acceleration methods, have a look at section 5 of the doc page.

Ray

Dear Lammps authors

         I am wondering why lammps didn't employ method for its
parallization, i.e., using openmp and openmpi at the same time? Since it is

this is not correct! have you read the manual? LAMMPS *does* support
hybrid. you can use OpenMP via the USER-OMP package and the KOKKOS
package on top of MPI. in fact, USER-OMP is part of the official
LAMMPS distribution for over 4 years now and been available through
LAMMPS-ICMS much longer.

not very hard to implement change openmp into the code and lammps don't have
openmp, did that mean the hybrid method didn't have much advantage with
one-level openmpi method? Thanks very much!

there are benefits, but they usually are not as large as you might
think and while sprinkling a few OpenMP directives into a code may
seem simple and straightforward, it is not quite as easy to make it
work *correctly* and as efficient as MPI. there are issues with data
races, false sharing, data locality, not thread safe function calls
and cache efficiency. not all of them can be resolved efficiently
without doing a complete rewrite of LAMMPS.

axel.

Thanks very much! Axel and Ray. I have just read the manual of openmp from the manual. I might just thought about the openmp code from my class.

Thanks very much! Axel and Ray. I have just read the manual of openmp from
the manual. I might just thought about the openmp code from my class.

i *strongly* advise against working on your code without first getting
some practice and experience on something simpler. like i mentioned,
it is not as simple to get it right. ...and if you want to use the
infrastructure provided by and used in USER-OMP, you have to have much
better code reading skills than what you have demonstrated so far.

there is a rather educational exercise with an *extremely* simplified
MD code that i have been using at HPC workshops for many years, that
is quite good at demonstrating the possible strategies and pitfalls.
e.g. check out point 4 of this page:

https://sites.google.com/site/akohlmey/lectures/ictptwas-caribbean-school-2012

there are talk slides, fill-in example codes and more.

axel.

Thanks, Axel. Learn a lot through reading the paper and your email. I would keep on learning.