Bill Allombert on Wed, 19 Mar 2025 18:57:14 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: I need help for parallel optimization
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: I need help for parallel optimization
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Wed, 19 Mar 2025 18:57:10 +0100
- Delivery-date: Wed, 19 Mar 2025 18:57:14 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=math.u-bordeaux.fr; s=2022; t=1742407032; bh=TTgXbMpDj12PzvtoVzBX8WLLbHoY3yZl4t4PEJyLcTg=; h=Date:From:To:Subject:References:In-Reply-To:From; b=tOQQs3YYgSSVYtV1uj25ifuO4Zt5GE8Y++PI//9l0CSJXWm/Qb7Zwtt5RvumjDf6l s1xjTakivhTuRP4S5uf+u8wJqU7aMKP26YN/zxggMFQSHaD9S2Lgmay6LTPlJqz3cU DxLV8kH3UfKhuXka9i35xtZKLKqZhs/tm+TyG5w/TXT2Vwc7aWeSqeUKboqSqcvJMx NTOYWRdCpbdLeriRpchuVvER4l24RESv7Q1kgR4wPprHeDwcwTHxf9Ey9U7JpG56+i 0nLmOy6FwUwZMYg3+OM84xLe0Po7DYP1qL0mMo2ffXjwgTYZDgcO7/LmDAPQ4quCqb jUVpweT0Dfna9koQFPBTitkrqN77mhbkwnH+uwwiGIP5ZV8garRRxNKFIQr8EXMuG0 XnoJPQaV6ndwBlFNN5PKjdoCuktfTDpWT6aQz7t9nlATVoe1zVB0SLlcSUYccVLhu+ cBBz/iC3Tn+eqFKCMzCHqblAj6bzLs0Taqiq27hvyjifdezTeGH9yo8xtA/j3zZGO3 rmtCZsZCfd3YaOlB7bQBP7wv1Tdu+x4sxy7in+a3+kCfDhLpn4kcT3BAqMrjIxvE+h 4ZBSGfMZ4T3lSkwn/FveSNam8ajYD0nqSdTnpYBtv9Cg/fjR8kSyhHXC8BE2JlNcU0 6PWYYJO3fNBZmOHTBqkhHa0M=
- In-reply-to: <8c3f70b2-67f9-4669-8a24-be08ab18dbd4@filmsons.com>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <8c3f70b2-67f9-4669-8a24-be08ab18dbd4@filmsons.com>
On Wed, Mar 19, 2025 at 06:34:51PM +0100, Jean-Luc Arnaud wrote:
> Hi all,
>
> I've coded a GP Script calculating Pi digits based en Chudnovski algorithm.
>
> It works very well and fast (≈ 1 min 43 s for 1 000 000 digits) but I'd like
> to optimize it with parallel calculation.
It is not really possible. There is few part of the algorithm that can run at
the same time.
Also it is not needed, PARI uses the same formula and need less than 1s without
parallelism.
The trick is to use a technique known as binary splitting to compute the sum.
To start with something easier, what you can try to speed it up a bit (without
paralelism) is to keep track of the numerators and denominators of ak, a_sum
and bsum separately.
That is
num_a_k = num_a_k*(-(6*i-5)*(2*i-1)*(6*i-1))
den_a_k = den_a_k* (i^3* C3);
etc.
Cheers,
Bill.