5
$\begingroup$

Are there any rules of thumb to optimize the number of CPUs to perform a LAMMPS simulation of a given size efficiently?

For example, there are 32 cores under each node in my computational resource. How do I choose the proper number of nodes and the proper number of cores for the LAMMPS simulation? Does it depend on the number of system atoms in the simulation or on something else?

Any suggestions appreciated.

$\endgroup$

1 Answer 1

4
$\begingroup$

Choosing the optimal number of processors is heavily dependent on many things:

  • number of atoms (more atoms tends to allow more processors to be used)
  • chosen algorithm (algorithms with more numerics can sometimes be distributed to a greater extend)
  • implementation specific details (some codes are very good at distributing work, which might scale better than other codes)
  • compilation optimizations, poor optimizations can lead to better performance scaling, but slower code altogether.
  • the hardware you are using, your rule of thumb for your current nodes, might not be valid when you get new hardware (this is especially true for GPU's).
  • most hardware nodes in nowadays HPC facilities uses NUMA (Non-Uniform-Memory-Access) nodes. Here the distribution of your cores on the node also decides the performance (memory location, affinity)

I don't know of any rules of thumb for LAMMPS. But only a proper benchmark on your test system and number of cores would actually do the job.

So I would suggest you to take a small system of yours, tune the number of iterations so it will run in ~ 10 minutes (no more than an hour). Run the calculation on the same hardware, for 1, 2, 4, 8, 16, 24, 32 cores and plot the performance. If it scales nicely up to 32 cores, then great! :) You can go ahead and play with a 2nd node. Now try with 4 cores on each node. And increase number of cores on each node simultaneously.

When the performance seems to flatten out, then it might be better to use fewer cores. :) There is no need to add more cores if you only get 1-5% of performance of what you would expect (an ideal scaling code would be twice as fast, if you doubled the number of cores).

$\endgroup$
3
  • $\begingroup$ For context, the present question stems from the comments on this other question: mattermodeling.stackexchange.com/q/12768/4515 $\endgroup$ Commented Apr 16 at 21:56
  • $\begingroup$ @nickpapior Thank you for your suggestions. I will try this test on my cluster. $\endgroup$
    – Kieran
    Commented Apr 16 at 22:23
  • $\begingroup$ This is probably the best suggestion. I had to do something similar when I started doing calculations with LAMMPS. I performed a test job with 1 node, let it run to completion and started increasing the number of nodes/processors until I optimized the time of mu jobs $\endgroup$
    – Baba Booey
    Commented Apr 18 at 20:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .