[CppAD] **tape_id++

bradbell at seanet.com bradbell at seanet.com
Mon Oct 29 20:15:37 EDT 2012


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
>




More information about the CppAD mailing list