[ADOL-C] trace_on with keep=1
Kshitij Kulshreshtha
kshitij at math.upb.de
Mon Apr 13 05:48:37 EDT 2015
Hello,
You are quite correct that the traces are overwritten if you call
trace_on(tag) again with the same tag. Also, the jacobian() function
creates its own taylor trace, therefore it is completely unnecessary to
use keep == 1 if you are calling jacobian() afterwards. Keep is only
required if you are calling reverse() directly after trace_off().
In your example the matrix Jac is allocated in each iteration but never
freed. Add a myfree2(Jac) just before the end of the while (1) loop and
you'll see no more memory increase.
best wishes
Kshitij
On 2015-04-10 22:15, Antoine De Blois wrote:
> Hi again,
>
>
>
> Please have a look at the attached code. I reproduced the memory leak
> with keep=1.
>
>
>
> So is there a way to “flush” the Taylor stack at a given point? For us,
> keep=1 helps to speed-up the process, so I’d like to keep the keep=1!!
>
> Best,
>
> Antoine
>
>
>
>
>
> *De :*adol-c-bounces at list.coin-or.org
> [mailto:adol-c-bounces at list.coin-or.org] *De la part de* Antoine De Blois
> *Envoyé :* Friday, April 10, 2015 3:31 PM
> *À :* adol-c at list.coin-or.org
> *Cc :* Patrice Castonguay
> *Objet :* [ADOL-C] trace_on with keep=1
>
>
>
> Hi everyone,
>
>
>
> Quick question regarding the usage of keep=1 while creating the tape.
> Would the following snippet create the memory leak:
>
>
>
> int keep = 1;
>
> while (1)
>
> {
>
> trace_on(0,keep);
>
> // <<= operations
>
> // …
>
> // ==> operations
>
> trace_off();
>
> jacobian(…);
>
> }
>
>
>
> I was assuming that since the tag number remains 0, then the Taylor
> stack would be overwritten. Is that correct?
>
>
>
> I am currently observing a RAM increase with our code when using ADOL-C
> and trying to figure out its origin. We are using ADOL-C in a CFD
> adjoint design optimization process, in which the code constantly
> computes jacobians for different geometries.
>
>
>
> I launched valgrind on the side, but since the application uses MPI,
> valgrind outputs many “false positives”…
>
> Thank you for your time,
>
> Antoine
>
>
>
> *De :*adol-c-bounces at list.coin-or.org
> <mailto:adol-c-bounces at list.coin-or.org>
> [mailto:adol-c-bounces at list.coin-or.org]
> <mailto:[mailto:adol-c-bounces at list.coin-or.org]> *De la part de* Ralf
> Juengling
> *Envoyé :* Tuesday, April 07, 2015 4:33 PM
> *À :* adol-c at list.coin-or.org <mailto:adol-c at list.coin-or.org>
> *Objet :* [ADOL-C] Can ADOL-C handle FFTs?
>
>
>
> I would like to use ADOL-C for a problem Y = C(X) where the
> implementation of C uses FFT routines and I want ADOL-C to give me the
> gradient of C wrt X.
>
>
>
> I did a quick trial using the pyadolc Python wrapper and that failed.
> Before I play around further, could someone tell me if ADOL-C can handle
> FFTs at all? If not, can any automatic differentiation tool do this?
>
>
>
> Thanks,
> Ralf
>
>
>
>
>
> _______________________________________________
> ADOL-C mailing list
> ADOL-C at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/adol-c
>
--
Dr. Kshitij Kulshreshtha
Institut für Mathematik,
Universität Paderborn,
Warburger Straße 100,
33098 Paderborn.
Büro: TP21.1.21
Besucheradresse:
Technologiepark 21
33098 Paderborn.
Privatanschrift:
Arnikaweg 62
33100 Paderborn.
More information about the ADOL-C
mailing list