PvPython and PvBatch
Introduction
ParaView can run without opening the ParaView GUI, and is controlled through Python. There are two Python interfaces - PvPython and PvBatch.
PvPython
PvPython is the Python intreface to ParaView. You can think of PvPython as ParaView with a Python interface. As we did with the Python Shell, you can manually type in commands to pvpython . PvPython can also read Python command files. For instance,
- fullPathToPvPython/pvpython fullPathToPythonCommandFile/commandFile.py
- d:\alan\paraview\pvpython d:\alan\scripts\disk_out_ref-A.py
- You will notice that pvpython will run the script and then exit. The output of the script is a screenshot or or other data product.
- Anywhere that needs editing in the scripts above will be marked by the string editMeHere.
- You will need to hard code in the paths to your data, and paths for output products.
- The first time you run a script with pvpython, the output will be a postage stamp sized window. You can change this by finding and uncommenting the line renderView1.ViewSize.
- Try making and running a script of your own. Alternatively, try running the scripts available on the ParaView and Python wiki page.
PvBatch
PvBatch is like PvPython, with two exceptions. PvBatch only accepts commands from input scripts, and PvBatch will run in parallel if it was built using MPI. Input is exactly like PvPython.
Sandia National Labs specific section
This section is specific to the clusters and environment at Sandia National Laboratories.
PvBatch on the clusters
ssh into one of the clusters. PvBatch can be run on the login nodes, and magically will acquire compute nodes and run your batch visualization in parallel. You will find test scripts at /projects/viz/training/paraview. These scripts are run as follows:
- /projects/viz/paraview/bin/pvbatch_redsky_mesa
- This is version 4.4.0 of pvbatch.
- Incorrect number of argument supplied. Expecting 4 but have 0
- Usage: /projects/viz/paraview/bin/pvbatch_redsky_mesa <Nodes> <Minutes> <HERT estimate> batchFileFullPath
- An example is
- /projects/viz/paraview/bin/pvbatch_redsky_mesa 1 10 FY123456 /projects/viz/training/paraview/whipple-A.py
PvBatchOnNode on the clusters
pvbatch can be run on the same nodes as your simuation. Ask ParaView help for more information on how to use this feature.
Where do you go next?
- Python calculator and programmable fitler.
Acknowledgements
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000.