andresy/torch — pull request #55 by pflaquerre (2012-08-31 15:39:46+00:00)
Title: remove temp files when done in gnuplot

This is just a quick fix to make the gnuplot wrapper remove the temporary files it creates. Our cluster's /tmp was getting a bit crowded:

find /tmp -iname 'lua_*'|wc -l
1085923

You could also avoid calling gnuplothasterm multiple times by creating a table of supported terminals when the wrapper is loaded.

If you ever change your dependencies to gnuplot >= 4.4, then you could replace that awkward "set terminal\n\n" with a simple "gnuplot -e 'print GPVAL_TERMINALS'", which prints all supported terminals on a single line. This avoids issues with the pager's "Press enter to continue:" that currently get interleaved with the terminal list (quick fix for now: "PAGER=cat gnuplot").