Re: Forprime and posix multithreading

Bill Allombert <[email protected]>
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <aGJpkzTvTf3Ono5D@seventeen>
On Mon, Jun 30, 2025 at 10:14:13AM +0000, Piercarlo Giannattasio wrote:
> Good morning,
> I'm trying to code a prime number generator in a specified range, using GP
> and C, and I need to reduce processing times.

What is a prime number generator ? How is it different from forprime ?

> I'm trying to use forprime and posix multithreading, but when executing the
> code I'm exceeding the parisizemax. I've tried with 1-15 threads, assigning
> 16GB of memory only to PARI, but I still get the same error: sometimes it
> only calculates the first iteration of forprime_next...

You need to set threadsizemax too.

> Also, is there any technical documentation for the C implementation, besides
> the one I'm studying (User Guide, Tutorial, Introduction to gp2c,
> Introduction to Parallel GP) ?

Thre are the libpari manual, the examples directory, and of course the PARI source code.

But I suggest you send me your code, I will tell you what you need to read.

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.