[Trilinos-Users] Tpetra threading questions

David Hysom hysom1 at llnl.gov
Mon Apr 14 10:03:11 MDT 2014


When constructing a map we pass the number of threads
in a parameter list. I had thought that meant that each map
(and subsequently CrsMatrix) had an independent number of
threads. I've just figured out that, for OpenMP nodes, Tpetra
calls set_num_threads(), which is globally scoped.

This causes difficulties for our scenario: we have a pool of
matrices, and we periodically add matrices to the pool, or
extract a matrix for use (e.g, LOBPCG). The matrices can
vary greatly in size, and we've been constructing a Map for
each, with a number of threads intended to optimize performance.
Now we've learned that the number of threads will be whatever
was used in the most recently constructed matrix, due to the
call to set_num_threads().

My question is: do the TBB and TPI nodes act similarly, e.g, the
number of threads is a global attribute?

thanks, David

More information about the Trilinos-Users mailing list