[CppAD] **tape_id++

Jason Roos jroos at rsm.nl
Tue Oct 30 10:24:28 EDT 2012


Thanks for the reply. I believe this will work for now, as I don't need CPPAD_MAX_NUM_THREADS to be the default of 48. But I'm not sure this will be the case down the road. 

-----Original Message-----
From: cppad-bounces at list.coin-or.org [mailto:cppad-bounces at list.coin-or.org] On Behalf Of bradbell at seanet.com
Sent: Tuesday, October 30, 2012 01:16
To: cppad at list.coin-or.org
Subject: Re: [CppAD] **tape_id++


CppAD does not re-use thread_id values because it identifies variables as AD<double> values that have the same tape identifier as the current AD<double> tape.

As soon as the tape stops recording, its variables become parameters without having to manage a linked list from the tape to its not yet destructed variables.

The simplest solution would be if size_t on your machine is larger than unsigned int. In that case you could use the configure argument
      TAPE_ID_TYPE=tape_id_type
to change the tape id type; see
       http://www.coin-or.org/CppAD/Doc/installunix.xml#tape_id_type

Another possible solution is to use a small value for the configure argument
     MAX_NUM_THREADS=max_num_threads
(this is the amount that the tape id is incremented each time); see
     http://www.coin-or.org/CppAD/Doc/installunix.xml#max_num_threads
also see
     http://www.coin-or.org/Cpp/Doc/multi_thread.xml#CPPAD_MAX_NUM_THREADS


> Hi,
>
> I just noticed that CppAD increments **tape_id every time I create a 
> new tape. That's a good thing, except I'm running out of unsigned 
> ints. Is there a safe way to reset the **tape_id periodically? (Note 
> that I'm not running out of memory, just unsigned ints...)
>
> Thanks,
> Jason
>
> --------------------------------Disclaimer----------------------------
> ---- De informatie  verzonden in dit e-mail bericht  inclusief de 
> bijlage(n) is vertrouwelijk  en is  uitsluitend  bestemd  voor de 
> geadresseerde  van dit bericht. Lees verder: 
> http://www.eur.nl/email-disclaimer
>
> The information in this e-mail message  is confidential and may be 
> legally privileged. Read more: 
> http://www.eur.nl/english/email-disclaimer
> ----------------------------------------------------------------------
> ----
>
> _______________________________________________
> CppAD mailing list
> CppAD at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cppad
>


_______________________________________________
CppAD mailing list
CppAD at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/cppad
--------------------------------Disclaimer--------------------------------
De informatie  verzonden in dit e-mail bericht  inclusief de bijlage(n) is
vertrouwelijk  en is  uitsluitend  bestemd  voor de geadresseerde  van dit
bericht. Lees verder: http://www.eur.nl/email-disclaimer

The information in this e-mail message  is confidential and may be legally
privileged. Read more: http://www.eur.nl/english/email-disclaimer
--------------------------------------------------------------------------



More information about the CppAD mailing list