save command in SAGE

asked 2013-09-01 11:07:15 -0600

Sandi Xhumari gravatar image

updated 2015-01-17 15:39:12 -0600

FrédéricC gravatar image

I'm trying to save a 'big' rational matrix in SAGE, but I'm running into problems. After computing my matrix A, which has size 5 x 10,000 and each entry contains rational numbers in fraction form with total number of digits for numerator and denominator more than 10 pages, I run the following command: save(A, DATA + 'A'). This gives me the following error message:

Traceback(most recent call last): ... RuntimeError: Segmentation fault.

After this, I can't access A at all any more. In other words, when I try to compute say A[2,3], I get an error. However, before running the save command I was able to compute this entry. Also, I tried the same save command with a 'smaller' matrix and that worked fine. I should also note that I'm using a laptop with 64-bit operating system, x64-based processor, Windows 8, i7 CPU @ 2.40 GHz and 8 GB RAM. Let me know if you need further information. My questions are: 1. Why can't I save my matrix? Why do I get the above error message? What does it mean? 2. How can I save my matrix A? Is there any other way I can save it?

edit retag flag offensive close merge delete



So you must be using a virtual machine to run Sage, right? How much RAM have you allocated to it? Does it help if you increase the RAM?

John Palmieri gravatar imageJohn Palmieri ( 2013-09-01 14:13:19 -0600 )edit

Oh, I didn't know there's a way to allocate RAM to the virtual machine. I will try that and let you know. Thank you for your suggestion. Do you know why we need to allocate RAM manually btw? How come the vm will not just take RAM automatically if needed? After going to Machine/Settings it gave me the option to allocate more RAM, but it also warned me that if I allocate too much, the machine might not be able to run. What's the reason for that? Is there a guideline for deciding the amount of RAM I should allocate?

Sandi Xhumari gravatar imageSandi Xhumari ( 2013-09-02 09:57:42 -0600 )edit

After increasing the allocated RAM from 512 MB to 5237 MB, the computation finished way faster, but I still got the same error message after the 'save' command. However, I am still able to access the matrix after running the save command, so I think your suggestion solved part of the problem. Thank you! Any other ideas how to fix the rest?

Sandi Xhumari gravatar imageSandi Xhumari ( 2013-09-02 12:54:49 -0600 )edit

can you try saving it using the standard Python pickle? (or cPickle).

Dima gravatar imageDima ( 2013-09-16 20:19:18 -0600 )edit