[CppAD] Multi-Threading
Dominik Skanda
Dominik.Skanda at biologie.uni-freiburg.de
Mon Mar 12 10:53:00 EDT 2012
Thanks for the bug report below:
This bug has been fixed; see the heading 03-11 on
http://www.coin-or.org/CppAD/Doc/whats_new_12.htm#03-11
Note that
Perhaps others reading the CppAD list would be interested in this bug
and the corresponding discussion in the whats new file. As suggested by
Jey in
http://list.coin-or.org/pipermail/cppad/2012q1/000253.html
more work needs to be done in the documentation to make these sort if
issues clear. Feel free to send a copy of this message to
CppAD at list.coin-or.org if you like.
On 03/08/2012 08:32 AM, Dominik Skanda wrote:
> Hello,
>
> I have played with my example and version cppad-20120308 of CppAD:
>
> First I encountered a Bug (to be true I'm not really sure if it is a
> bug), but for the simple example (without multi-threading):
>
>
> main.cpp:
>
> #include<iostream>
> #include<vector>
> #include<cppad/cppad.hpp>
>
> int main (int argc, char *argv[])
> {
>
> // TAPING THE FUNCTION
>
> CppAD::vector< CppAD::AD<double> > x(2);
> x[0]=3.78;
> x[1]=7.33;
> CppAD::Independent(x);
> CppAD::vector< CppAD::AD<double> > y(1);
> y[0]=sin(x[0])+cos(x[1]);
>
> CppAD::ADFun<double> fun;
> fun.Dependent(x,y);
> fun.optimize();
>
> return 0;
> }
>
> valgrind complains for the execution "valgrind --leak-check=full
> --show-reachable=yes ./a.out" with :
>
>
>
> ==5384== Memcheck, a memory error detector
> ==5384== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
> ==5384== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for
> copyright info
> ==5384== Command: ./a.out
> ==5384==
> ==5384==
> ==5384== HEAP SUMMARY:
> ==5384== in use at exit: 2,416 bytes in 1 blocks
> ==5384== total heap usage: 37 allocs, 36 frees, 64,870 bytes allocated
> ==5384==
> ==5384== 2,416 bytes in 1 blocks are still reachable in loss record 1 of
> 1
> ==5384== at 0x4026351: operator new(unsigned int)
> (vg_replace_malloc.c:255)
> ==5384== by 0x8049D6A: CppAD::thread_alloc::thread_info(unsigned int,
> bool) (in /home/dskanda/Programmierung/THREADING/a.out)
> ==5384== by 0x804A457: CppAD::thread_alloc::get_memory(unsigned int,
> unsigned int&) (in /home/dskanda/Programmierung/THREADING/a.out)
> ==5384== by 0x8052295: CppAD::pod_vector<unsigned
> char>::extend(unsigned int)
> (in /home/dskanda/Programmierung/THREADING/a.out)
> ==5384== by 0x804C776: CppAD::recorder<double>::PutOp(CppAD::OpCode)
> (in /home/dskanda/Programmierung/THREADING/a.out)
> ==5384== by 0x804D799: void
> CppAD::ADTape<double>::Independent<std::vector<CppAD::AD<double>,
> std::allocator<CppAD::AD<double> > > >(std::vector<CppAD::AD<double>,
> std::allocator<CppAD::AD<double> > >&)
> (in /home/dskanda/Programmierung/THREADING/a.out)
> ==5384== by 0x804BC06: void
> CppAD::Independent<std::vector<CppAD::AD<double>,
> std::allocator<CppAD::AD<double> > > >(std::vector<CppAD::AD<double>,
> std::allocator<CppAD::AD<double> > >&)
> (in /home/dskanda/Programmierung/THREADING/a.out)
> ==5384== by 0x80493B7: main
> (in /home/dskanda/Programmierung/THREADING/a.out)
> ==5384==
> ==5384== LEAK SUMMARY:
> ==5384== definitely lost: 0 bytes in 0 blocks
> ==5384== indirectly lost: 0 bytes in 0 blocks
> ==5384== possibly lost: 0 bytes in 0 blocks
> ==5384== still reachable: 2,416 bytes in 1 blocks
> ==5384== suppressed: 0 bytes in 0 blocks
> ==5384==
> ==5384== For counts of detected and suppressed errors, rerun with: -v
> ==5384== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 19 from 8)
>
>
>
>
>
... snip ...
More information about the CppAD
mailing list