hermann on Mon, 05 Jun 2023 17:56:23 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Abnormous memory use for gaussian gcd()?


I am new to Pari/GP and learned the first steps.
I am in the process of transpiling my RSA_numbers_factored.py from Python to Pari/GP
(did the same to JavaScript/NodeJS before):

I uploaded small .tar file with the 4 files for this question:

With precomputed sqrtm1 = sqrt(-1) mod p Python code computes gcd(p, sqrtm1+I).

For 10000 decimal digits prime:
$ python3.9 10000.py
gcd(p, sqrtm1 + I): 0.6292035579681396s

No problem for 36401 decimal digits prime as well:
$ python3.9 36401.py
gcd(p, sqrtm1 + I): 12.862614154815674s

Transpiled GP code for 10000-digit number works fine:

$ gp 10000.gp
  ***   last result computed in 4,709 ms.

But even though I give 24G of my laptop's 32G to Pari, computation does not complete.
What am I doing wrong?
Or is this a bug in Pari/GP?
Python 3.9, Pari/GP 2.15.3.

$ grep ^parisize /etc/gprc
parisizemax = 24G
parisize = 24G
$ gp 36401.gp
Reading GPRC: /etc/gprc
GPRC Done.
parisizemax = 24000000000, primelimit = 500000
  ***   The result history is empty.
  ***   Break loop: type 'break' to go back to GP prompt


Hwermann Stamm-Wilbrandt.