[IPOL discuss] hyperthreading and openmp

eml enric.meinhardt at cmla.ens-cachan.fr
Mon Dec 5 11:18:17 CET 2011


hi,

We are trying to optimize a demo for IPOL using openmp.  We have
observed a clear improvment when using more than one thread.  However,
we do not know which number of threads should the demo use.  The
default of the openmp library is to use as many threads as available
processors.  However, this is not the optimal choice in any sense,
because:

1. the elapsed time of the algorithm is not the shortest one
2. the total cpu time is much larger

See the attatched graph of running times, tested on the "green" server
for one run of the algorithm (notice: the scale of the running time is
logarithmic).

I send this mail to ask for advice or opinion on the default number of
threads that an OMP demo should use.  Either as a constant, or as a
way to compute this number from the system.

I suspect that the best choice is one less than the real number of
processors (thus, 15 for the green server).  Above this point, there
are diminishing returns in increasing the number of threads while the
total CPU time, which could be used for other demos, is wasted.

I do not understand how OMP interacts with the hyperthreading that
this server has enabled, but I guess that it is never useful to run
two OMP threads on the same processor multiplexed by hyperthreading.

regards,
Enric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: green.png
Type: image/png
Size: 7000 bytes
Desc: not available
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20111205/d8bd1048/attachment.png>


More information about the discuss mailing list