First time here? Check out the FAQ!

Ask Your Question
2

How to change the prefix to SAGE_TMP?

asked 10 years ago

ikol gravatar image

updated 10 years ago

SAGE_TMP looks something like this by default: /tmp/tmpGMP2PR. My /tmp is full but I have plenty of space in a different tmp directory on another disk. How can I change the default prefix in SAGE_TMP from /tmp to, say, /raid/scratch?

Thanks.

Preview: (hide)

Comments

Which version of Sage are you using? For me the temporary directory is in home/.sage/temp/... This is what you can see from

sage: from sage.misc.misc import SAGE_TMP
sage: SAGE_TMP
'/home/..../.sage/temp/...'

On the other hand, if you are using the Sage notebook it does also uses some temporary directory which is I guess in /tmp/ by default.

vdelecroix gravatar imagevdelecroix ( 10 years ago )

I am using v6.4.1.~/.sage/temp/ is different. If I run a Notebook session, its files are stored under ~/.sage/notebook/... but while a Sage calculation is running all the files there are just links to /tmp/something where /tmp/something is the value of SAGE_TMP in that session. I am saving large objects via the save() command and that's where I have the problem, because they can't fit in /tmp. There has got to be a way in Sage to set the prefix for SAGE_TMP from /tmp to something else.

ikol gravatar imageikol ( 10 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 5 years ago

William Stein2 gravatar image

There is no way to customize just SAGE_TMP, though you can customize ~/.sage by setting DOT_SAGE. You can see from the source code at https://github.com/sagemath/sage/blob... that SAGE_TMP is hardcoded as a function of the hostname and pid. I vaguely recall writing this code 13 years ago to avoid conflicts when running multiple copies of Sage. It seems pretty annoying now, and it could easily lead to ~/.sage/temp getting really big if Sage keeps crashing, whereas often /tmp on systems gets automatically cleaned up (at least on reboot). Also, /tmp is often on a much faster filesystem than ~/.sage (which might be mounted over NFS). Sigh. I hope somebody changes this.

Preview: (hide)
link

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: 10 years ago

Seen: 776 times

Last updated: Dec 10 '19