help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: making many plots quickly


From: Francesco Potorti`
Subject: Re: making many plots quickly
Date: Wed, 08 Oct 2008 18:01:45 +0200

>| Using the movie.m function that I posted some time ago (and that you can
>| find at <http://fly.isti.cnr.it/pub/software/octave/movie.m>) I can make
>| movies from a series of plots saved on disk as .png files.
>| 
>| The way it works is that I use for each frame
>|   figure("visible","off")
>| then I create the plot and save it as png with
>|   drawnow("png",sprintf("%6d.png",fileno++))
>| and at the end I call ffmpeg or whatever.
>| 
>| When making many plots (hundreds or thousands) I see that octave and
>| gnuplot take each 50% of CPU usage.  Looking ad drawnow.m, the cause
>| seems to be that when drawing a plot to a file the pipe to gnuplot is
>| closed each time.  If I could keep the pipe open, I could exploit having
>| a dual-core CPU to make things faster.  And probably I would also save
>| the CPU power needed to create and close a process for each frame.
>
>I don't understand why opening and closing the plot stream would limit
>you to one CPU.  Is opening and closing the pipe really the bottleneck
>in the process?

I do not know.  I suspected that when closing the pipe meant that Octave
was waiting on Gnuplot for something to answer, and so they could not
work in parallel.  But it was just guessing, while trying to explain why
they took about 50% CPU each, when I have 200% to spare.  Was I wrong?

>If you want to keep the plot stream open, how do you propose doing it?
>Remember that there may be a plot on the screen, and that should not
>go away when drawnow is called again to print a plot to a file.  So
>would you keep two plot streams open for each figure?  Or would there
>be a dedicated gnuplot process just for printing?  Also, one advantage
>to restarting gnuplot for each figure that is printed is that you
>don't have to worry about the state of the gnuplot process, and
>whether there have been any errors that might cause trouble.

I do not know how to answer this yet.  In fact, I had begun looking more
closely at drawnow.m, and it is more complex than I hoped.  So I am not
sure the work is worth it.  But I'll see, thank you for the insight.

>Instead of asking us, why not just do it if you think it would help
>you?  Then if the change is useful to you, it seems likely that it
>might also be useful to others, so you might as well submit it.

This answers my question, thank you.

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]