<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br class=""><blockquote type="cite" class="">On Dec 11, 2016, at 9:53 PM, Bradley Lucier <<a href="mailto:lucier@math.purdue.edu" class="">lucier@math.purdue.edu</a>> wrote:<br class=""><br class="">Is there a way for me to try to run it in parallel?<br class=""><br class="">Brad<br class=""><br class=""><span id="cid:BF771FC3-17F8-442C-AC25-EFBE7C25E696@iro.umontreal.ca"><chud-parallel.scm></span><br class=""></blockquote><br class=""><div class="">I tried your program on my working copy of Gambit (rather brittle, but good enough to run simple tests like this).  I computed 1 million digits of pi.  On 1 processor it takes 15 seconds real-time, and on 7 processors it takes 9 seconds.  Not a great improvement.</div><div class=""><br class=""></div><div class="">When I look at the activity log (attached below) I see that the program is not very parallel.  It seems threads are only generated in the main part of the computation, between 2000 ms and 5000 ms into the execution.  When I review the source code, I think the first 2000 ms are used to compute sequentially the square root of a 2 million digit bignum, and after the 5000 ms mark, the program computes sequentially (quotient (* p ch-C sqrt-C) (* ch-D (+ q (* p ch-A)))) with large bignums.</div><div class=""><br class=""></div><div class="">So to improve the performance, it would be necessary to improve the parallelism in those two parts.  The square root could probably be done concurrently with the main computation (for a small number of processors, otherwise a parallel square root algorithm needs to be devised).  The tail part of the computation might be improved by parallel algorithms for multiplication and division.</div><div class=""><br class=""></div><div class="">Marc</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><img apple-inline="yes" id="341FA08C-CCFA-4B11-8941-FA412875624F" height="397" width="1036" apple-width="yes" apple-height="yes" src="cid:47120D9E-2196-408F-9F4E-3D398328D1D8@iro.umontreal.ca" class=""></div><div class=""><br class=""></div></body></html>