Ask Your Question
1

PARI stack overflows

asked 2018-06-12 11:38:18 -0500

RegularUser gravatar image

updated 2018-06-13 17:25:02 -0500

Trying to determine the kernel of a map between free ZZ-modules of finite rank, I get the following error

  File "/home/ubuntu/SageMath/local/lib/python2.7/site-packages/sage/modules/matrix_morphism.py", line 720, in kernel
    V = self.matrix().kernel()
  File "sage/matrix/matrix2.pyx", line 4337, in sage.matrix.matrix2.Matrix.left_kernel (build/cythonized/sage/matrix/matrix2.c:32211)
  File "sage/matrix/matrix2.pyx", line 4178, in sage.matrix.matrix2.Matrix.right_kernel (build/cythonized/sage/matrix/matrix2.c:31652)
  File "sage/matrix/matrix2.pyx", line 3782, in sage.matrix.matrix2.Matrix.right_kernel_matrix (build/cythonized/sage/matrix/matrix2.c:30166)
  File "sage/matrix/matrix_integer_dense.pyx", line 2558, in sage.matrix.matrix_integer_dense.Matrix_integer_dense._right_kernel_matrix (build/cythonized/sage/matrix/matrix_integer_dense.c:22234)
  File "cypari2/gen.pyx", line 4483, in cypari2.gen.Gen.matkerint
  File "cypari2/handle_error.pyx", line 196, in cypari2.handle_error._pari_err_handle
cypari2.handle_error.PariError: the PARI stack overflows (current size: 259719168; maximum size: 259719168)
You can use pari.allocatemem() to change the stack size and try again

How do I adjust the maximum PARI stack size from within Sage?

Edit: Strangely, whether this problem occurs does not only depend on the total memory used. In one case, the computation used up to 14 GB and ran just fine, in another case this error occured when only 8 GB had been used.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-06-13 10:23:16 -0500

tmonteil gravatar image

Your computation might be too heavy, but it is hard to say without a concrete example.

That said, you can try to enlarge the pari stack size:

You can get the current stack size as follows:

sage: pari.stacksize()

You can set a larger stacksize as follows:

sage: pari.allocatemem(10^9)
edit flag offensive delete link more

Comments

Would computing the kernel of an integer matrix of size about 2000x2000 be "heavy"?

RegularUser gravatar imageRegularUser ( 2018-06-13 11:59:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-06-12 11:38:18 -0500

Seen: 77 times

Last updated: Jun 13