Michael & others,
thanks for working on these things -- indeed starting 240 threads does not 
seem like a good idea :-)

I admit knowing little about the internals of TBB. My understanding is the 
following:
- the first time TBB facilities are used, the TBB sees if a task scheduler
  has already been set up and if not does so automatically. By default,
  a task scheduler is set up that uses n_cpus+1 threads. This is 
  overridden by the code you post. This number is unrelated to
  the setting of MultithreadInfo::n_default_threads
- after that, the TBB sets up a thread pool -- i.e. it starts as many
  threads as necessary but immediately blocks them, i.e. they are
  available for work, but don't do work yet
- it then schedules work to available threads as necessary. Not all threads
  do work at all time -- in fact, most do nothing most of the time.

Here are a couple questions to find longer-term solutions:
- I assume you put the code snippet you posted into main(), right? If so
  we could document this in the appropriate places as the solution to use.
- Did you ever figure out a way to change the number of threads a scheduler
  uses *later on*? If there was one, we could have a function that sets
  MultithreadInfo::n_default_threads *and* changes the scheduler.

By and large, I think the TBB does the right thing most of the time, but 
there should be ways to work around these issues on large NUMA systems...

Best
 W.

-------------------------------------------------------------------------
Wolfgang Bangerth                email:            [email protected]
                                 www: http://www.math.tamu.edu/~bangerth/

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to