<div dir="ltr">Hi<div><br></div><div>The problem with coordinates.cpp is fixed with new update.<br><div class="gmail_extra"><br></div><div class="gmail_extra">Best<br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Giang</div></div></div>
<br><div class="gmail_quote">On Fri, Aug 4, 2017 at 9:26 AM, Kshitij Kulshreshtha <span dir="ltr"><<a href="mailto:kshitij@math.uni-paderborn.de" target="_blank">kshitij@math.uni-paderborn.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
in svn commit 740 on trunk or git commit 5ae5bf59 of the master branch<br>
from 2017-05-30 some corrections to taylor.c in the ADOL-C source code<br>
were already made. This was a fix for memory errors.<br>
<br>
Brad's program runs in valgrind for me with no errors, as does Hoang's<br>
example from additional_examples/taylor/<wbr>coordinates.c<br>
<br>
Please switch to SVN trunk or GIT master and let me know if you still<br>
see a problem. (I'm travelling starting tomorrow morning, so I'll be<br>
able to get to it, when I'm back on 21st Aug).<br>
<br>
Best,<br>
Kshitij<br>
<div><div class="h5"><br>
<br>
<br>
On 08/04/17 08:16, Andrea Walther wrote:<br>
> Dear Hoang Giang Bui,<br>
><br>
> thanks for letting us know! That indeed helps a lot.<br>
><br>
> Best regards<br>
><br>
> Andrea<br>
><br>
><br>
>> I checked that further and found that this example still works in<br>
>> v2.5.2 but fail at v2.6.0. I think that can be helpful for you to<br>
>> track down this problem.<br>
>><br>
>> Best<br>
>><br>
>><br>
>> Giang<br>
>><br>
>> On Thu, Aug 3, 2017 at 10:43 PM, Hoang Giang Bui <<a href="mailto:hgbk2008@gmail.com">hgbk2008@gmail.com</a><br>
>> <mailto:<a href="mailto:hgbk2008@gmail.com">hgbk2008@gmail.com</a>>> wrote:<br>
>><br>
>>     Hello<br>
>><br>
>>     I also got the error of inverse_tensor_eval. I executed the example<br>
>>     in examples/additional_examples/<wbr>taylor/coordinates and received the<br>
>>     error below. I used ADOL-C 2.6.3<br>
>><br>
>>     COORDINATES (ADOL-C Example)<br>
>><br>
>>       Cartesian coordinates:<br>
>>       z_1: (e.g. 4)<br>
>>     4<br>
>>       z_2: (e.g. 3)<br>
>>     3<br>
>><br>
>>       Polar coordinates:<br>
>>       z_3: (e.g. 5)<br>
>>     5<br>
>>       z_4: (e.g. 0.64350110879 <tel:06435%200110879>)<br>
>>     0.64<br>
>><br>
>>       Highest derivative degree = 3<br>
>>     *** Error in `./coordinates': double free or corruption (out):<br>
>>     0x0000000000c8df90 ***<br>
>>     Aborted (core dumped)<br>
>><br>
>>     Please help to take a look.<br>
>><br>
>>     Giang<br>
>><br>
>>     On Thu, Aug 3, 2017 at 8:32 PM, Brad Bell <<a href="mailto:bradbell@seanet.com">bradbell@seanet.com</a><br>
>>     <mailto:<a href="mailto:bradbell@seanet.com">bradbell@seanet.com</a>>> wrote:<br>
>><br>
>>         I have am trying to run a simple example using<br>
>>         inverse_tensor_eval. To be specific<br>
>>                  F(z) = sin(z)<br>
>>         I have been unable to figure out why I am getting memory errors<br>
>>         when I run the<br>
>>         code included below. When I run it in valgrind, I get the<br>
>>         following output:<br>
>><br>
>> ==============================<wbr>==============================<wbr>==============================<wbr>=======<br>
>><br>
>>         build>valgrind ./adolc<br>
>>         ==29183== Memcheck, a memory error detector<br>
>>         ==29183== Copyright (C) 2002-2015, and GNU GPL'd, by Julian<br>
>>         Seward et al.<br>
>>         ==29183== Using Valgrind-3.12.0 and LibVEX; rerun with -h for<br>
>>         copyright info<br>
>>         ==29183== Command: ./adolc<br>
>>         ==29183==<br>
>>         ==29183== Invalid free() / delete / delete[] / realloc()<br>
>>         ==29183==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)<br>
>>         ==29183==    by 0x4F8B731: inverse_tensor_eval (taylor.c:741)<br>
>>         ==29183==    by 0x401094: main (adolc.cpp:37)<br>
>>         ==29183==  Address 0x699cf38 is 8 bytes inside a block of size<br>
>>         32 alloc'd<br>
>>         ==29183==    at 0x4C2FA50: calloc (vg_replace_malloc.c:711)<br>
>>         ==29183==    by 0x4E63FA5: myalloc2 (adalloc.c:125)<br>
>>         ==29183==    by 0x4F8B1B5: inverse_tensor_eval (taylor.c:688)<br>
>>         ==29183==    by 0x401094: main (adolc.cpp:37)<br>
>>         ==29183==<br>
>>         ==29183== Invalid free() / delete / delete[] / realloc()<br>
>>         ==29183==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)<br>
>>         ==29183==    by 0x4F8B74C: inverse_tensor_eval (taylor.c:743)<br>
>>         ==29183==    by 0x401094: main (adolc.cpp:37)<br>
>>         ==29183==  Address 0x699cf98 is 8 bytes inside a block of size<br>
>>         32 alloc'd<br>
>>         ==29183==    at 0x4C2FA50: calloc (vg_replace_malloc.c:711)<br>
>>         ==29183==    by 0x4E63FA5: myalloc2 (adalloc.c:125)<br>
>>         ==29183==    by 0x4F8B1D2: inverse_tensor_eval (taylor.c:689)<br>
>>         ==29183==    by 0x401094: main (adolc.cpp:37)<br>
>>         ==29183==<br>
>>         tensor[0][0] = 0.523599 <tel:0.523599><br>
>>         tensor[0][1] = 1.1547<br>
>>         tensor[0][2] = 0.7698<br>
>>         z = 0.523599 <tel:0.523599><br>
>>         zp = 1.1547<br>
>>         zpp = 0.7698<br>
>>         adolc: Done<br>
>>         ==29183==<br>
>>         ==29183== HEAP SUMMARY:<br>
>>         ==29183==     in use at exit: 1,094 bytes in 20 blocks<br>
>>         ==29183==   total heap usage: 107 allocs, 89 frees, 19,481,090<br>
>>         bytes allocated<br>
>>         ==29183==<br>
>>         ==29183== LEAK SUMMARY:<br>
>>         ==29183==    definitely lost: 104 bytes in 6 blocks<br>
>>         ==29183==    indirectly lost: 8 bytes in 1 blocks<br>
>>         ==29183==      possibly lost: 0 bytes in 0 blocks<br>
>>         ==29183==    still reachable: 982 bytes in 13 blocks<br>
>>         ==29183==         suppressed: 0 bytes in 0 blocks<br>
>>         ==29183== Rerun with --leak-check=full to see details of leaked<br>
>>         memory<br>
>>         ==29183==<br>
>>         ==29183== For counts of detected and suppressed errors, rerun<br>
>>         with: -v<br>
>>         ==29183== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0<br>
>>         from 0)<br>
>>         build><br>
>><br>
>> ==============================<wbr>==============================<wbr>==============================<wbr>=======<br>
>><br>
>>         # include <adolc/adolc.h><br>
>>         int main(void)<br>
>>         {<br>
>>              int n = 1;    // number of independent and dependent<br>
>> variables<br>
>>              int d = 2;    // highest order derivative<br>
>>              int p = 1;    // number of directions<br>
>>              int size = 3; // [(p + d) choose d] = (p+d-0) *...* (p+1) /<br>
>>         (1 *...* d)<br>
>>              //<br>
>>              double* S[1];      // seed matrix S[n][p]<br>
>>              S[0] = new double[p];<br>
>>              //<br>
>>              double* tensor[1]; // partials of z w.r.t x tensor[n][size]<br>
>>              tensor[0] = new double[size];<br>
>><br>
>>              // Set Seed matrix to identity<br>
>>              S[0][0] = 1.0;<br>
>><br>
>>              // independent and dependent variables<br>
>>              adouble az[1], ay[1]; // az[n], ay[n]<br>
>>              double  z[1],  y[1];  //  z[n],  y[n]<br>
>><br>
>>              // record operations for y = F(z) = sin(z)<br>
>>              short int tag = 1;     // tape identifier<br>
>>              trace_on(tag);         // start recording<br>
>>              z[0]  = 1.0;           // value during recording<br>
>>              az[0] <<= z[0];        // independent variable<br>
>>              ay[0] = sin(az[0]);    // function evaluation<br>
>>              ay[0] >>= y[0];        // dependent variable<br>
>>              trace_off();           // turn off recording<br>
>><br>
>>              // evaluate inverse of F at x0<br>
>>              double x0 = 0.5;            // argument for inverse<br>
>>              z[0]      = std::asin(x0);  // F^-1 (x0) = z0<br>
>>              inverse_tensor_eval(tag, n, d, p, z, tensor, S);<br>
>><br>
>>              // print tensor<br>
>>              for(int j = 0; j < size; j++)<br>
>>              {   std::cout << "tensor[0][" << j << "] = " <<<br>
>>         tensor[0][j] << "\n";<br>
>>              }<br>
>><br>
>>              // derivative of F^-1 (x0)  =  1.0 / sqrt( 1 - x0 * x0 )<br>
>>              double zp = 1.0 / std::sqrt(1.0 - x0 * x0 );<br>
>><br>
>>              // second derivative of F^-1 (x0)  =  x0 / sqrt( 1 - x0 *<br>
>>         x0 )^3<br>
>>              double zpp = x0 * zp * zp * zp;<br>
>><br>
>>              // print derivatives for z<br>
>>              std::cout << "z = " << z[0] << "\n";<br>
>>              std::cout << "zp = " << zp << "\n";<br>
>>              std::cout << "zpp = " << zpp << "\n";<br>
>>              //<br>
>>              delete [] S[0];<br>
>>              delete [] tensor[0];<br>
>>              //<br>
>>              std::cout << "adolc: Done\n";<br>
>>              return 0;<br>
>>         }<br>
>><br>
>>         ______________________________<wbr>_________________<br>
>>         ADOL-C mailing list<br>
>>         <a href="mailto:ADOL-C@list.coin-or.org">ADOL-C@list.coin-or.org</a> <mailto:<a href="mailto:ADOL-C@list.coin-or.org">ADOL-C@list.coin-or.<wbr>org</a>><br>
>><br>
>> <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_adol-2Dc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=0eOhD1zcLnB9JhadNXrezwNw87TYLa0fyHrxCkWC5J8&m=_Ons9tqju2E2RHmPQy2M4dxzTzDANdgNNsqJlGe3_xE&s=nCnpB-VNJPhm9DrrYdYukpvGjJLoI0XJjc321inwUW0&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.<wbr>com/v2/url?u=https-3A__list.<wbr>coin-2Dor.org_mailman_<wbr>listinfo_adol-2Dc&d=DwICAg&c=<wbr>Ngd-<wbr>ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLx<wbr>WPA_2Wlc4&r=<wbr>0eOhD1zcLnB9JhadNXrezwNw87TYLa<wbr>0fyHrxCkWC5J8&m=_<wbr>Ons9tqju2E2RHmPQy2M4dxzTzDANdg<wbr>NNsqJlGe3_xE&s=nCnpB-<wbr>VNJPhm9DrrYdYukpvGjJLoI0XJjc32<wbr>1inwUW0&e=</a><br>
>><br>
>><br>
>> <<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_adol-2Dc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=0eOhD1zcLnB9JhadNXrezwNw87TYLa0fyHrxCkWC5J8&m=_Ons9tqju2E2RHmPQy2M4dxzTzDANdgNNsqJlGe3_xE&s=nCnpB-VNJPhm9DrrYdYukpvGjJLoI0XJjc321inwUW0&e=" rel="noreferrer" target="_blank">https://urldefense.<wbr>proofpoint.com/v2/url?u=https-<wbr>3A__list.coin-2Dor.org_<wbr>mailman_listinfo_adol-2Dc&d=<wbr>DwICAg&c=Ngd-<wbr>ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLx<wbr>WPA_2Wlc4&r=<wbr>0eOhD1zcLnB9JhadNXrezwNw87TYLa<wbr>0fyHrxCkWC5J8&m=_<wbr>Ons9tqju2E2RHmPQy2M4dxzTzDANdg<wbr>NNsqJlGe3_xE&s=nCnpB-<wbr>VNJPhm9DrrYdYukpvGjJLoI0XJjc32<wbr>1inwUW0&e=</a>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> ADOL-C mailing list<br>
>> <a href="mailto:ADOL-C@list.coin-or.org">ADOL-C@list.coin-or.org</a><br>
>> <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_adol-2Dc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=sszAvj5-wJal_YaNkOXa8y4Mts3w-L-xYDXwPYeYptQ&m=gfhyE5RpFM_GBYHEyusXs5ASuA5gN4cmZKSjaEDKGxk&s=zYFcDozFnxwQ6LdZOXeaoV7XItU8I-J9XrCp3JyCP_Q&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.<wbr>com/v2/url?u=https-3A__list.<wbr>coin-2Dor.org_mailman_<wbr>listinfo_adol-2Dc&d=DwICAg&c=<wbr>Ngd-<wbr>ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLx<wbr>WPA_2Wlc4&r=sszAvj5-wJal_<wbr>YaNkOXa8y4Mts3w-L-<wbr>xYDXwPYeYptQ&m=gfhyE5RpFM_<wbr>GBYHEyusXs5ASuA5gN4cmZKSjaEDKG<wbr>xk&s=<wbr>zYFcDozFnxwQ6LdZOXeaoV7XItU8I-<wbr>J9XrCp3JyCP_Q&e=</a><br>
>><br>
>><br>
><br>
<br>
--<br>
</div></div>PD. Dr. Kshitij Kulshreshtha<br>
<br>
Institut für Mathematik,<br>
Universität Paderborn,<br>
Warburger Straße 100,<br>
33098 Paderborn.<br>
<br>
Büro: TP21.1.21<br>
Besucheradresse:<br>
Technologiepark 21<br>
33098 Paderborn.<br>
<br>
Privatanschrift:<br>
Arnikaweg 62<br>
33100 Paderborn.<br>
<span class="">______________________________<wbr>_________________<br>
ADOL-C mailing list<br>
<a href="mailto:ADOL-C@list.coin-or.org">ADOL-C@list.coin-or.org</a><br>
</span><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_adol-2Dc&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=0eOhD1zcLnB9JhadNXrezwNw87TYLa0fyHrxCkWC5J8&m=KcxBQJzGZutD_kGYQ_VRBx_yR1L42B9tupJWApEsaVQ&s=WBVap8MwRJOZwQeqsPRtjZpWcbGUZo9EB80HNlXNdVo&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.<wbr>com/v2/url?u=https-3A__list.<wbr>coin-2Dor.org_mailman_<wbr>listinfo_adol-2Dc&d=DwIGaQ&c=<wbr>Ngd-<wbr>ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLx<wbr>WPA_2Wlc4&r=<wbr>0eOhD1zcLnB9JhadNXrezwNw87TYLa<wbr>0fyHrxCkWC5J8&m=KcxBQJzGZutD_<wbr>kGYQ_VRBx_<wbr>yR1L42B9tupJWApEsaVQ&s=<wbr>WBVap8MwRJOZwQeqsPRtjZpWcbGUZo<wbr>9EB80HNlXNdVo&e=</a> </blockquote></div><br></div></div></div>