[mesa-users] OpenMP vs. MPI

Josiah Schwab jwschwab at berkeley.edu
Thu Sep 25 13:12:32 EDT 2014

Hi All,

> In reality, you may wish to compare the performance to see just how much 
> slower the cluster cores are.  In my case, my desktop is only about 10-30% 
> faster, but I have 8 cores (4 physical cores, hyperthreaded), compared to 
> being able to muster many hundreds on the cluster when necessary.

Speaking of hyperthreading (HT), Bill and I had a conversation at the
MESA Summer school which I have long meant to follow up on.

Should you set OMP_NUM_THREADS to the number of physical cores or the
number of hyperthreaded cores?  If a program is doing an excellent job
of keeping the CPU busy, you don't expect HT to get you any benefit.

Years ago, I did some quick benchmarks and determined HT helped enough
that I've been setting OMP_NUM_THREADS to the number of virtual cores.

During the summer school I did a simple test with the latest MESA
version.  Here's a plot of how long the 1M_pre_ms_to_WD test case took
on my 4 physical core (8 virtual w/ HT) desktop.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hyperthreading.png
Type: image/png
Size: 18094 bytes
Desc: not available
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20140925/aa5b5e11/attachment.png>
-------------- next part --------------

So on this problem, on a 4 year old Xeon processor, hyperthreading sped
things up by about 20%.

There's no reason to expect that this is a problem-independent,
machine-independent result, though it seems clear HT won't ever buy you
order unity speed improvements.  Users may want to do simple benchmarks
and see what is working best for them.


More information about the Mesa-users mailing list