From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3a6a9f1d654285ba X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!novso.com!news.skynet.be!195.238.0.222.MISMATCH!newsspl501.isp.belgacom.be!tjb!not-for-mail Date: Fri, 04 Sep 2009 12:17:46 +0200 From: Olivier Scalbert User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada Shootout program for K-Nucleotide (patches) References: <4a743343$0$32674$9b4e6d93@newsspool2.arcor-online.net> <3f9f9e21-e088-4fbe-baac-dd43fdf6b911@r38g2000yqn.googlegroups.com> <4a757b0d$0$31328$9b4e6d93@newsspool4.arcor-online.net> <4a9fc85a$0$2850$ba620e4c@news.skynet.be> <1a5e1270-6a0a-4fff-a9b4-965abe610b69@o9g2000yqj.googlegroups.com> <4a9fdd46$0$2853$ba620e4c@news.skynet.be> <4aa0afbf$0$2864$ba620e4c@news.skynet.be> <3df8815d-b65a-4f73-9015-65375dcff113@x38g2000yqb.googlegroups.com> In-Reply-To: <3df8815d-b65a-4f73-9015-65375dcff113@x38g2000yqb.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4aa0e963$0$2868$ba620e4c@news.skynet.be> Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 5fb126ed.news.skynet.be X-Trace: 1252059491 news.skynet.be 2868 81.246.238.10:33133 X-Complaints-To: usenet-abuse@skynet.be Xref: g2news2.google.com comp.lang.ada:8148 Date: 2009-09-04T12:17:46+02:00 List-Id: Ludovic Brenta wrote: > I cannot help more with gprof as I've never used it before but it > seems to me that profiling the unoptimized program is pointless. It is > much better to profile the fully optimized and inlined program; for > this I still recommend valgrind because it gives accurate measurements > for every instruction. > > -- > Ludovic Brenta. Ok, let's switch to valgrind ! First, let's check memory leaks: $ gnatmake -gnatNp -O3 -g -fomit-frame-pointer -march=native -f knucleotide.adb -o knucleotide.gnat_run $ valgrind --max-stackframe=20000000 --leak-check=full --show-reachable=yes ./knucleotide.gnat_run < fasta/fasta25m.dat ==13802== ==13802== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 21 from 1) ==13802== malloc/free: in use at exit: 12,512,380 bytes in 3 blocks. ==13802== malloc/free: 145 allocs, 142 frees, 396,773,180 bytes allocated. ==13802== For counts of detected errors, rerun with: -v ==13802== searching for pointers to 3 not-freed blocks. ==13802== checked 12,680,612 bytes. ==13802== ==13802== 12,512,380 bytes in 3 blocks are still reachable in loss record 1 of 1 ==13802== at 0x4026FDE: malloc (vg_replace_malloc.c:207) ==13802== by 0x42C1664: __gnat_malloc (in /usr/lib/libgnat-4.3.so.1) ==13802== by 0x406993E: system__task_primitives__operations__new_atcb (in /usr/lib/libgnarl-4.3.so.1) ==13802== by 0x406C7AD: system__tasking__initialize (in /usr/lib/libgnarl-4.3.so.1) ==13802== by 0x406C186: system__tasking__initialization__init_rts (in /usr/lib/libgnarl-4.3.so.1) ==13802== by 0x406C2A6: system__tasking__initialization___elabb (in /usr/lib/libgnarl-4.3.so.1) ==13802== by 0x804AFA0: adainit (b~knucleotide.adb:162) ==13802== by 0x804AD50: ??? (start.S:119) ==13802== ==13802== LEAK SUMMARY: ==13802== definitely lost: 0 bytes in 0 blocks. ==13802== possibly lost: 0 bytes in 0 blocks. ==13802== still reachable: 12,512,380 bytes in 3 blocks. ==13802== suppressed: 0 bytes in 0 blocks. Mmmm, 3 blocks are still reachable. 3 workers ? Second, let's profile: $ valgrind --max-stackframe=20000000 --leak-check=yes ./knucleotide.gnat_run < fasta/fasta25m.dat 25 minutes later ... callgrind_annotate --inclusive=yes --tree=both --auto=yes callgrind.out.14048 > callgrind_out_14048.txt As the file is quit big, you can find it there: http://scalbert.dyndns.org/ada/knucleotide/callgrind_out_14048.txt As it is the first time I use this tool, do not hesitate to ask me a new run with other options ! Enjoy, Olivier