Is there an easy to to tell if I succeeded in compiling cln to 64 bit on OS X?<br><br><div class="gmail_quote">On Sat, Dec 11, 2010 at 6:00 AM, <span dir="ltr"><<a href="mailto:cln-list-request@ginac.de">cln-list-request@ginac.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Send CLN-list mailing list submissions to<br>
<a href="mailto:cln-list@ginac.de">cln-list@ginac.de</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://www.cebix.net/mailman/listinfo/cln-list" target="_blank">https://www.cebix.net/mailman/listinfo/cln-list</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:cln-list-request@ginac.de">cln-list-request@ginac.de</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:cln-list-owner@ginac.de">cln-list-owner@ginac.de</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of CLN-list digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Does someone see a way to speed this up (Bruno Haible)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sat, 11 Dec 2010 00:50:47 +0100<br>
From: Bruno Haible <<a href="mailto:bruno@clisp.org">bruno@clisp.org</a>><br>
To: <a href="mailto:cln-list@ginac.de">cln-list@ginac.de</a><br>
Cc: Joshua Friedman <<a href="mailto:crowneagle@gmail.com">crowneagle@gmail.com</a>><br>
Subject: Re: [CLN-list] Does someone see a way to speed this up<br>
Message-ID: <<a href="mailto:201012110050.49085.bruno@clisp.org">201012110050.49085.bruno@clisp.org</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi Joshua,<br>
<br>
> I am using a lot of function calls, would passing constant pointers speed up<br>
> my program significantly? ...<br>
> I don't expect people to read the code, just look at the way I am using cln.<br>
> Is this an efficient way?<br>
<br>
Based on past experience, not on your program in particular, here's a list<br>
of suggestions, starting with the most promising ones, and the least<br>
promising ones at the end.<br>
<br>
1) Use a profiler that displays the bottlenecks and relative consumption<br>
of CPU time. On Linux/x86, the tool of choice is<br>
valgrind <<a href="http://valgrind.org/docs/manual/cl-manual.html" target="_blank">http://valgrind.org/docs/manual/cl-manual.html</a>>, together<br>
with kcachegrind for the visualization of the results.<br>
<br>
2) Are you using excess precision in large parts of the computations?<br>
Often, in order to get 20 digits of a result, you need 40 digits<br>
throughout the computation if you choose a constant precision.<br>
But sometimes you can actually do part of the computation with<br>
22 digits and part with 40 digits, and the result will still have<br>
20 digits of accuracy.<br>
For analyzing this, you need to have a certain understanding of the<br>
numerical stability of your algorithm. For example, when you are<br>
evaluating integrals along a path around a pole, you use 40<br>
digits in the computation and get 20 digits accuracy in the result;<br>
but when you are evaluating an integrals along a path around a<br>
region with no singularity, then 40 digits in the computation normally<br>
lead to slightly less than 40 digits accuracy in the result.<br>
<br>
3) When computing integrals, use higher-order integration methods than<br>
simple averaged summation, if the integrand has continuous derivates.<br>
If your integrand is infinitely differentiable, then Runge-Kutta<br>
(the formula with 1/6, 4/6, 1/6) is a big win, and higher-order<br>
Runge-Kutta methods are even better.<br>
<br>
4) Pull calls to transcendental functions out of loops if possible.<br>
In CLN, elementary operations and sqrt are fast, whereas sin, exp,<br>
log, etc. are significantly slower.<br>
<br>
5) Pull common computations out of loops. The compiler won't do it<br>
for it. Things like cl_float(2,prec)*PI are quite fast to compute,<br>
but you may save a couple of percent by moving all these "trivial"<br>
common subexpressions outside the loops.<br>
<br>
6) Then only, start to worry about whether you pass numbers by<br>
"copy" (e.g. cl_N x) or by reference (e.g. const cl_N& x).<br>
CLN numbers are references anyway, so by doing this you can save<br>
the increment and decrement of a reference count, nothing else.<br>
If you had many function calls and many small-sized bignums<br>
and floats, you could save maybe at most 20% by using this trick.<br>
It's more a micro-optimization than the other five points.<br>
<br>
Bruno<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
CLN-list mailing list<br>
<a href="mailto:CLN-list@ginac.de">CLN-list@ginac.de</a><br>
<a href="https://www.cebix.net/mailman/listinfo/cln-list" target="_blank">https://www.cebix.net/mailman/listinfo/cln-list</a><br>
<br>
<br>
End of CLN-list Digest, Vol 55, Issue 2<br>
***************************************<br>
</blockquote></div><br><br clear="all"><br>-- <br>Joshua Friedman PhD<br><a href="mailto:CrownEagle@gmail.com">CrownEagle@gmail.com</a><br><a href="http://www.math.sunysb.edu/~joshua">http://www.math.sunysb.edu/~joshua</a><br>