[Paraview] resume python script from last position

Burlen Loring bloring at lbl.gov
Fri Jul 26 12:53:03 EDT 2013


Hi John,

> I am/was looking for a snippet which would (say) look at my directory, 
> see that pic_0000, pic_0001, pic_0002 (for example) exist and then 
> tell me that I need to resume from timestamp 0003 ... or 
> alternatively, just write out some index to a temp file and then read 
> it back and use that to resume from.

I often do this kind of thing. I've structured my pvbatch script to 
process a single timestep named on the command line. I have a bash 
script that looks in the dataset input dir for simulation timesteps and 
image output dir for rendered images. If the given input time's output 
image does not exist it kicks off a job. This structure has the benefit 
that it's parallel over time simulation time. I re-run the bash script 
until it submits no jobs, this easily catches failed jobs. note: my 
script has some logic to work around the fact that TACC only is allowing 
20 jobs in the queue at once, presumable you don't need that. You may 
need to use environment variables to pass info into your job, TACC's 
unique in that the batch system passes command line arguments.

Burlen

On 07/26/2013 01:47 AM, Biddiscombe, John A. wrote:
>
> Jean,
>
> Thanks. Does the time.asctime() write the wall/clock time?
>
> I am/was looking for a snippet which would (say) look at my directory, 
> see that pic_0000, pic_0001, pic_0002 (for example) exist and then 
> tell me that I need to resume from timestamp 0003 ... or 
> alternatively, just write out some index to a temp file and then read 
> it back and use that to resume from. My main script isn't working yet 
> to generate the images I want, so I've not tried to implement the read 
> back resume position. I'm expecting to generate 5000 frames and it may 
> take quite a long time.
>
> JB
>
> *From:*Favre Jean
> *Sent:* 26 July 2013 10:05
> *To:* Biddiscombe, John A.; paraview at paraview.org
> *Subject:* RE: resume python script from last position
>
>
> you may use for example time, and replacing space with underscore.
>
> import time
>
> view.WriteImage(format("pic_" + time.asctime().replace(" ", "_") + 
> ".png"), "vtkPNGWriter", 1)
>
> -----------------
> Jean/CSCS
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130726/c61c4cb4/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqtk-batch-submit-all.sh
Type: application/x-shellscript
Size: 2433 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130726/c61c4cb4/attachment.bin>


More information about the ParaView mailing list