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()?


Hi,

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):
https://github.com/Hermann-SW/RSA_numbers_factored

I uploaded small .tar file with the 4 files for this question:
https://stamm-wilbrandt.de/en/pari-users/Q1.tar


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
...
39178247477405595462999004573259238447193580865522753006504996585341802644743745733315578184178833806642718982619192126965967031226198644279480298699929676[+++]
  ***   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
foobar
  ***   The result history is empty.
  ***   Break loop: type 'break' to go back to GP prompt
break>


Regards,

Hwermann Stamm-Wilbrandt.