[gambit-list] Computing pi with parallel gambit
Bradley Lucier
lucier at math.purdue.edu
Mon Dec 12 16:52:16 EST 2016
On 12/12/2016 04:39 PM, Marc Feeley wrote:
>
>> On Dec 11, 2016, at 9:53 PM, Bradley Lucier <lucier at math.purdue.edu
>> <mailto:lucier at math.purdue.edu>> wrote:
>>
>> Is there a way for me to try to run it in parallel?
>>
>> Brad
>>
>> <chud-parallel.scm>
>
> I tried your program on my working copy of Gambit (rather brittle, but
> good enough to run simple tests like this).
Thanks, it looks very interesting!
> 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.
>
> So to improve the performance, it would be necessary to improve the
> parallelism in those two parts.
Absolutely.
> 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).
Yes, the computation to the square root should be carried out in
parallel with the computation of gpg.
> The tail part of the computation might be improved by
> parallel algorithms for multiplication and division.
The two arguments to
(quotient (* p ch-C sqrt-C) (* ch-D (+ q (* p ch-A)))))))
can be computed in parallel.
I appreciate you trying this experiment. The activity log is a pretty
good tool!
Brad
More information about the Gambit-list
mailing list