[CppAD] Multi-threading with TBB?

Brad Bell bradbell at seanet.com
Wed Dec 19 13:07:52 EST 2018


Here is the link to the key CppAD requirements for multi-threading
https://coin-or.github.io/CppAD/doc/ta_parallel_setup.htm

CppAD has to know a maximum number of threads, and which thread is currently running.
It seems from
https://stackoverflow.com/questions/3786408/number-of-threads-used-by-intel-tbb
that this is not possible in TBB, but I am not sure.

On 12/19/2018 10:50 AM, Perry de Valpine wrote:
> Hello.  I'm not sure if you prefer queries here or on GitHub.  This is a general question so I'm 
> sending it to this list.
>
> I'm trying to see whether CppAD's multi-threading features can fit well with Threading Building 
> Blocks (TBB).  Has anyone combined these successfully?  The simplest TBB example is here: 
> https://software.intel.com/en-us/node/506057 . Since TBB abstracts away thread creation but CppAD 
> seems to require explicit thread management, I'm not sure if they're a natural fit for each 
> other.  I can start to see how it might be done but wanted to ask for any suggestions first since 
> I am relatively new to multi-threading issues.
>
> What I would like to do is create a tape in serial mode and then in parallel use multiple copies 
> of that tape. The CppAD examples all show each thread both creating and using a tape.   Is what I 
> want to do possible?  I would also like to do this for multiple tapes (of different operations) 
> that all get created once and then used repeatedly in different places.
>
> Based on the statements on parallel_ad (https://coin-or.github.io/CppAD/doc/parallel_ad.htm), 
> which are not totally clear to me (maybe because I lack the background), does one need to do the 
> parallel_setup and parallel_AD steps if multiple threads will be used only for running tapes 
> (ADFun objects) but not making new tapes?
>
> Thanks for the great software.
>
> Perry
>
>
>
> _______________________________________________
> CppAD mailing list
> CppAD at list.coin-or.org
> https://list.coin-or.org/mailman/listinfo/cppad



More information about the CppAD mailing list