Re: parsum and nbthreads

Bill Allombert <[email protected]>
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <ZHSm6xRk2/kUT+Tm@seventeen>
On Wed, May 24, 2023 at 10:32:47AM +0200, Loïc Grenié wrote:
>    Hi,
> 
>    I've recently used parsum(m2=1,20,<code>) on a 16-threaded
>   machine. parsum parallelizes the sum only up to floor(sqrt(20))
>   threads (hence 4 in my case, for a 16-threaded computer). While
>   this is certainly a good limit if the number of things to sum is
>   >= nbthreads^2, it is less good in the other case.

Use vecsum(parvector(20,m2,<code>))
parsum only makes sense for large sums when storing all the terms would
use too much memory.

vecsum(parvector) has the big advantage of always giving the same result.

Cheers,
Bill
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.