Appearance
Running a ParaView MPI visualization
When using the downloaded version of ParaView, you will need to use the mpiexec from the ParaView bundle.
bash
# Activate venv
source .pv-venv/bin/activate
# Install dependencies
uv pip install paraview-trame-components
py
import ptc
from paraview import simple
sphere = simple.Sphere()
rep = simple.Show(sphere)
view = simple.Render()
simple.ColorBy(rep, ("POINTS", "vtkProcessId"))
rep.RescaleTransferFunctionToDataRange(True, False)
rep.SetScalarBarVisibility(view, True)
web_app = ptc.Viewer()
web_app.start()
python
# shortcut to pvbatch and mpiexec
export MPI=/Applications/ParaView-5.13.3.app/Contents/bin/mpiexec
export PVBATCH=/Applications/ParaView-5.13.3.app/Contents/bin/pvbatch
# Run from repo
$MPI -n 4 $PVBATCH --venv .pv-venv ./code/04-visualization-3d/06-paraview-mpi.py