Scripting Paraview
Published:
Use script to batch process files in Paraview
This tutorial will generate script to be run on NERSC to generate files in Paraview.
Generate Batch Script
Option 1 –Script Recording
- Open local Paraview, go to
Tools
–Start Trace
- After finished rendering, go to
Tools
–Stop Trace
- It will pop up a python script with the recorded command lines.
- Save this
test.py
file.
Option 2 – Save statefile as .py
- Complete the normal operations in Paraview
- When ready, go to
File
–Save State...
, in theFiles of type
, select the dropdown withtest.py
format - Open the generated
test.py
file, and modify it as you like.
Run script on NERSC
See this documentation on running Paraview in Batch mode
- Upload the local
test.py
file to NERSC - Use the following command to submit jobs
cori$ module load ParaView
cori$ start_pvbatch.sh 4 4 haswell 00:30:00 default debug `pwd`/test.py
- You can change the file output directory in the
test.py
. - create a bash function to automate the process
pvbatch () {
start_pvbatch.sh 4 4 haswell 00:30:00 default debug `pwd`/$1
}