0% found this document useful (0 votes)
148 views234 pages

Supercomputing 2016 Tutorial: Large Scale Visualization With Paraview

Large Scale Visualization with ParaView ParaView is an open-source visualization application that supports distributed computation to process large datasets. It has a flexible user interface and supports many common file formats. The tutorial demonstrates basic usage of ParaView, including creating sources, manipulating cameras, changing properties, and supported data types.

Uploaded by

Henry Paz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
148 views234 pages

Supercomputing 2016 Tutorial: Large Scale Visualization With Paraview

Large Scale Visualization with ParaView ParaView is an open-source visualization application that supports distributed computation to process large datasets. It has a flexible user interface and supports many common file formats. The tutorial demonstrates basic usage of ParaView, including creating sources, manipulating cameras, changing properties, and supported data types.

Uploaded by

Henry Paz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 234

SAND2016-11450PE

Large Scale Visualization with ParaView

Supercomputing 2016 Tutorial


November 14, 2016
Kenneth Moreland David DeMarle
W. Alan Scott Kitware, Inc.
Sandia National Laboratories

Joseph Insley Jonathan Woodring


Argonne National Laboratory John Patchett
Los Alamos National Laboratory

Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia


Corporation, a wholly owned subsidiary of Lockheed Martin Corporation, for the U.S. Department of
Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000.
SAND 2015-7814 PE
Outline
•Introduction
•Basic Usage
•Batch Scripting
•Visualizing Large Models
•Catalyst
To Follow Along…
•Install ParaView 5.2.
– http://www.paraview.org  Download
•Installer also available on thumb drives.
–Please don’t steal the thumb drives.
– They are personal property volunteered by presenters.
– They have never touched a Sandia computer.
If You Need Help

I am fine. Please help.


Introduction
What is ParaView?
•An open-source, scalable, multi-
platform visualization application.
•Support for distributed computation
models to process large data sets.
•An open, flexible, and intuitive user
interface.
•An extensible, modular architecture
based on open standards.
•A flexible BSD 3 Clause license
•Commercial maintenance and support.
Renato N. Elias,
NACAD/COPPE/UFRJ,
Rio de Janerio, Brazil

Jerry Clarke, US Army Research Laboratory Swiss National


Supercomputing
Centre

Bill Daughton, LANL

Swiss National
Supercomputing
Centre
Current ParaView Usage
•Used by academic, government, and
commercial institutions worldwide.
•Downloaded ~100K times per year.
•HPCwire Editors’ Choice 2010 and
HPCwire Readers’ Choice 2010/2012
Awards for Best Visualization Product or
Technology.
Data Ranges
•Used for all ranges of data size.
•Landmarks of usage:
–6 billion structured cells (2005).
–250 million unstructured cells (2005).
–Billions of AMR cells (2008).
–Scaling test over 1 Trillion cells (2010).
–6.33 billion unstructured cells in Catalyst
(2016).
ParaView Application Architecture

ParaView Client pvpython ParaWeb Catalyst Custom App

UI (Qt Widgets, Python Wrappings)

ParaView Server

VTK

OpenGL MPI IceT Etc.


ParaView Development
• Started in 2000 as collaborative effort between Los
Alamos National Laboratories and Kitware Inc.
Sandia has been a major contributor since 2005.
– ParaView 0.6 released October 2002.
• Paraview 3.0 release in May 2007.
– GUI rewritten to be more user friendly and powerful.
• ParaView 4.0 released in June 2013.
– Properties panel redesign for smoother interaction.
• ParaView 5.0 released in January 2016.
– Updated to OpenGL 3.2 features. Huge performance
improvements.
Current Funding

• ARL • Other contributors


• ERDC – Swiss National
• US Army (SBIR) Supercomputing Centre
• US Air Force (STTR) – DOE SLAC
• ONR – Ohio State
• Support Contracts – Mississippi State
– Electricity de France – RPI
– Microsoft
Basics of Visualization
Data Types

Uniform Rectilinear Non-Uniform Rectilinear Curvilinear


(vtkImageData) (vtkRectilinearData) (vtkStructuredData)

Multi-block
Hierarchical Adaptive
Mesh Refinement
(AMR)
Hierarchical Uniform
Polygonal Unstructured Grid AMR
(vtkPolyData) (vtkUnstructuredGrid) Octree
More Information
•Online Help – F1
•The ParaView User’s Guide
– http://www.paraview.org/paraview-guide/

•Tutorials
–http://www.paraview.org/tutorials/
•The ParaView web page
–www.paraview.org
•ParaView mailing list
[email protected]
Help Menu
If You Need Help

I am fine. Please help.


Basic Usage
User Interface
Menu Bar

Toolbars

Pipeline Browser
3D View

Properties Panel

Advanced Toggle
Getting Back GUI Components
Creating a Cylinder Source
1. Go to the Source menu and select
Cylinder.
2. Click the Apply button to accept the
default parameters.
Simple Camera Manipulation
•Drag left, middle, right buttons for
rotate, pan, zoom.
–Also use Shift, Ctrl, Alt modifiers.
–Also try holding down x, y, or z.
Creating a Cylinder Source
1. Go to the Source menu and select
Cylinder.
2. Click the Apply button to accept the
default parameters.
3. Increase the Resolution parameter.

4. Click the button again.


Pipeline Object Controls
Using Auto Apply
1. Click Auto Apply.
2. Change the Resolution parameter
again.
3. Note that the visualization
automatically updates without having
to hit Apply.
Display Properties
Change Render Properties
1. Scroll down to the Display group.
2. Click the Edit button. (This button
is replicated in the toolbar.)
3. Select a new color for the cylinder.
Render View Options
Change Render Properties
1. Scroll down to the Display group.
2. Click the Edit button. (This button
is replicated in the toolbar.)
3. Select a new color for the cylinder.
4. Scroll down to the View group.
5. Turn on the Axis Grid.
Changing the Color Palette
1. Make sure the orientation axes are
visible in the lower left corner.

2. Click the color palette button and


change the colors.

3. Try several color palettes.


Color Palettes

→ Edit Current Palette…


Advanced Properties

Toggle
Search
Advanced
Properties
Properties
Searching Properties
1. Type “specular” in the properties
search box
2. Change Specular value to 1 (makes
the cylinder shiny)
Searching Properties
1. Type “specular” in the properties
search box
2. Change Specular value to 1 (makes
the cylinder shiny)

Other interesting properties:


• Axes Grid
• Opacity
• Lights
Undo Redo

Undo Redo

Camera Camera
Undo Redo
Creating a Cylinder Source
1. Go to the Source menu and select
Cylinder.
2. Click the Apply button to accept the
default parameters.
3. Increase the Resolution parameter.

4. Click the button again.


5. Delete the Cylinder.
Supported Data Types
• ParaView Data (.pvd) • Digital Elevation Map (.dem) • Meta Image (.mhd, .mha) • SLAC netCDF mesh and mode
• VTK (.vtp, .vtu, .vti, .vts, .vtr) • Dyna3D(.dyn) • Miranda (.mir, .raw) data
• VTK Legacy (.vtk) • EnSight (.case, .sos) • Multilevel 3d Plasma (.m3d, • SLAC netCDF particle data
• VTK Multi Block • Enzo boundary and hierarchy .h5) • Silo (.silo, .pdb)
(.vtm,.vtmb,.vtmg,.vthd,.vthb) • ExodusII (.g, .e, .exe, .ex2, • NASTRAN (.nas, .f06) • Spheral (.spheral, .sv)
• Partitioned VTK (.pvtu, .pvti, .ex2v.., etc) • Nek5000 Files • SpyPlot CTH
.pvts, .pvtr) • ExtrudedVol (.exvol) • Nrrd Raw Image (.nrrd, .nhdr) • SpyPlot (.case)
• ADAPT (.nc, .cdf, .elev, .ncd) • FVCOM (MTMD, MTSD, • OpenFOAM Files (.foam) • SpyPlot History (.hscth)
• ANALYZE (.img, .hdr) Particle, STSD) • PATRAN (.neu) • Stereo Lithography (.stl)
• ANSYS (.inp) • Facet Polygonal Data • PFLOTRAN (.h5) • TFT Files
• AVS UCD (.inp) • Flash multiblock files • PLOT2D (.p2d) • TIFF Image Files
• BOV (.bov) • Fluent Case Files (.cas) • PLOT3D (.xyz, .q, .x, .vp3d) • TSurf Files
• BYU (.g) • GGCM (.3df, .mer) • PLY Polygonal File Format • Tecplot ASCII (.tec, .tp)
• CAM NetCDF (.nc, .ncdf) • GTC (.h5) • PNG Image Files • Tecplot Binary (.plt)
• CCSM MTSD (.nc, .cdf, .elev, • GULP (.trg) • POP Ocean Files • Tetrad (.hdf5, .h5)
.ncd) • Gadget (.gadget) • ParaDIS Files • UNIC (.h5)
• CCSM STSD (.nc, .cdf, .elev, • Gaussian Cube File (.cube) • Phasta Files (.pht) • VASP CHGCA (.CHG)
.ncd) • JPEG Image (.jpg, .jpeg) • Pixie Files (.h5) • VASP OUT (.OUT)
• CEAucd (.ucd, .inp) • LAMPPS Dump (.dump) • ProSTAR (.cel, .vrt) • VASP POSTCAR (.POS)
• CMAT (.cmat) • LAMPPS Structure Files • Protein Data Bank (.pdb, .ent, • VPIC (.vpc)
• CML (.cml) • LODI (.nc, .cdf, .elev, .ncd) .pdb) • VRML (.wrl)
• CTRL (.ctrl) • LODI Particle (.nc, .cdf, .elev, • Raw Image Files • Velodyne (.vld, .rst)
• Chombo (.hdf5, .h5) .ncd) • Raw NRRD image files (.nrrd) • VizSchema (.h5, .vsh5)
• Claw (.claw) • LS-DYNA (.k, .lsdyna, .d3plot, • SAMRAI (.samrai) • Wavefront Polygonal Data
• Comma Separated Values d3plot) • SAR (.SAR, .sar) (.obj)
(.csv) • M3DCl (.h5) • SAS (.sasgeom, .sas, • WindBlade (.wind)
• Cosmology Files (.cosmo, • MFIX Unstructred Grid (.RES) .sasdata)
.gadget2) • XDMF and hdf5 (.xmf, .xdmf)
• MM5 (.mm5) • SESAME Tables • XMol Molecule
• Curve2D (.curve, .ultra, .ult, .u) • MPAS NetCDF (.nc, .ncdf)
• DDCMD (.ddcmd)
Custom Data Import:
Prototype with Python
• A “programmable
source” lets you
program data
readers right in the
GUI.
• Uses wrappings for
the basic VTK
classes.
• Good for prototyping
readers.
Custom Data Import:
Plugin Containing a Reader
•Plugins: shared object libraries that can
be dynamically loaded into ParaView.
•Any VTK reader object can be added.
•For help, try MIRARCO’s Plugin Wizard.
–http://pluginwizard.mirarco.org/
Load disk_out_ref.ex2
1. Open the file disk_out_ref.ex2
from the Examples directory.
Load disk_out_ref.ex2
1. Open the file disk_out_ref.ex2
from the Examples directory.
2. Load all data variables.

3. Click
Data Representation
Geometry Representations

Points Wireframe Surface Surface Volume


with Edges
Common Filters
Calculator Glyph

Contour Stream Tracer

Clip Warp (vector)

Slice Group Datasets

Threshold Extract Level

Extract Subset
Filters Menu
Quick Launch

• Used for searching


for filters by name
• Keyboard shortcut
– Ctrl-space for
Windows & Linux
– Alt-space for Mac
Apply a Filter
1. Make sure that disk_out_ref.ex2 is
selected in the pipeline browser.
2. Select the contour filter.
Apply a Filter
3. Change parameters to create an
isosurface at Temp = 400K.

Change to Temp

Change to 400
Apply a Filter
1. Make sure that disk_out_ref.ex2 is
selected in the pipeline browser.
2. Select the contour filter.
3. Change parameters to create an
isosurface at Temp = 400K.
4.
Create a Cutaway Surface
1. Select disk_out_ref.ex2 in the
pipeline browser.
2. From the quick launch, select
Extract Surface.
3.
Create a Cutaway Surface
1. Select disk_out_ref.ex2 in the
pipeline browser.
2. From the quick launch, select
Extract Surface.
3.
4. Create a clip filter.
5. Uncheck Show Plane.
6.
Pipeline Browser Structure
disk_out_ref.ex2

Contour1 ExtractSurface1

Clip1
Reset ParaView

Edit → Reset Session


Multiview
Multiview
1. Open disk_out_ref.ex2. Load all
variables.
2. Add Clip filter.
3. Uncheck Show Plane.
4.
5. Color surface by Pres.
Multiview
6. Split the view horizontally.
7. Make Clip1 visible.
8. Color surface by Temp.
Multiview
6. Split the view horizontally.
7. Make Clip1 visible.
8. Color surface by Temp.
9. Right-click view, Link Camera…
10. Click other view.
Multiview
6. Split the view horizontally.
7. Make Clip1 visible.
8. Color surface by Temp.
9. Right-click view, Link Camera…
10. Click other view.
11. Click
Modifying Views
Modifying Views
Reset ParaView

Edit → Reset Session


Streamlines
1. Open disk_out_ref.ex2. Load all
variables.
2. Add Stream Tracer.
3. Change Seed Type to Point Source.
4. Uncheck Show Sphere.
5.
Streamlines
1. Open disk_out_ref.ex2. Load all
variables.
2. Add Stream Tracer.
3. Change Seed Type to Point Source.
4. Uncheck Show Sphere.
5.
6. From the quick launch, select Tube
7.
Getting Fancy
6. Select StreamTracer1.
7. Add Glyph filter.
8. Change Glyph Type to Cone.
9. Change Vectors to V.
10. Change Scale Mode to vector.
11. Click reset next to Scale Factor.
12.
13. Color by Temp.
Getting Answers
•Where is the air moving the fastest?
Near the disk or away from it? At the
center of the disk or near its edges?
•Which way is the plate spinning?
•At the surface of the disk, is air moving
toward the center or away from it?
Reset ParaView

Edit → Reset Session


Common Data Analysis Filters
Extract Selection

Plot Global Variables Over Time

Plot Over Line

Plot Selection Over Time

Probe Location
Plotting
1. Open disk_out_ref.ex2. Load all
variables.
2. Clip, uncheck, ,
3. Select disk_out_ref.ex2.
4. Add Plot Over Line filter.
3D Widgets
Placing 3D Line Widget Endpoints
• Use the p key to place alternating points.
–Ctrl+p places at nearest mesh point.
• Use the 1 or 2 key to place the start or end
point.
–Ctrl+1 or Ctrl+2 places at mesh point.
• Drag the endpoints.
–Use x, y, or z key to constrain to axis.
• Use widgets in Properties panel
–E.g. Use Z Axis button and then edit points
to place from (0,0,0) to (0, 0, 10).
Plotting
1. Open disk_out_ref.ex2. Load all
variables.
2. Clip, uncheck, ,
3. Select disk_out_ref.ex2.
4. Add Plot Over Line filter.
5. Once line is satisfactorily located,
Interacting with Plots
•Left, middle, right buttons to pan, zoom.
•Mouse wheel to zoom.
•Reset view to plot ranges.
Plots are Views
•Move them like Views.
•Save screenshots.
Adjusting Plots
1. In Display section of properties
panel, turn off all variables except
Temp and Pres.
2. Select Pres in the Display options.
3. Change Chart Axis to
Bottom – Right.
4. Verify the relationship between
temperature and pressure.
Histogram / Bar Chart
1. Select disk_out_ref.ex2.
2. Filters → Data Analysis →
Histogram
3. Change Input Array to Temp.
4.
Reset ParaView

Edit → Reset Session


Geometry Representations

Points Wireframe Surface Surface Volume


with Edges
Volume Rendering +
Surface Geometry
1. Open disk_out_ref.ex2. Load all
variables.
2. Change variable viewed to Temp.
3. Change representation to Volume.
Transfer Function Editor
Modify Transfer Function
1. Select disk_out_ref.ex2.
2. Click Edit Color Map .
3. Click Choose preset .
4. Select Black-Body Radiation.
Apply. Close.
5. Try adding and changing control
points.
Rainbow Colors: Never Use Them

Pros: Cons:
• Pretty • Garish
• Good dynamic range • Bad for color blindness
• No implicit order
• Not perceptually even
Rainbow: Color Deficiencies
Rainbow: Implicit Ordering


Rainbow: Implicit Ordering
Rainbow: Perceptually Uneven

Blue Cyan Green YellowOrange Red


Volume Rendering +
Surface Geometry
1. Open disk_out_ref.ex2. Load all
variables.
2. Change variable viewed to Temp.
3. Change representation to Volume.
4. Add Stream Tracer.
5. Optional: Add Tubes and Glyphs.
Reset ParaView

Edit → Reset Session


Loading Data with Time
1. Open the file can.ex2.
2. Select all variables.
3.
4.
5.
Animation Toolbar

First Previous Next Last Loop


Frame Frame Play Frame Frame Animation Current Time Current Time Step
Animation Pitfall
1. Go to first time step.
2. Color by EQPS variable.
3. Play (or skip to last time step ).
Animation Pitfall
1. Go to first time step.
2. Color by EQPS variable.
3. Play (or skip to last time step ).
4. Fix with Rescale to Data Range.
Data Range Workarounds
•Go to representative time and hit
•In Settings change On File Open to
Goto last timestep.
Data Range Workarounds
•Set a custom range.
Data Range Workarounds
•Rescale to range over all timesteps
Reset ParaView

Edit → Reset Session


Animation View
View → Animation View
Animation View
View → Animation View

Animation Modes: Sequence, Real Time,


and Snap To TimeSteps
Changing Animation Timing
1. Open can.ex2. Load all variables.
2.
3. View → Animation View
4. Change Mode to Real Time.
• Default animation duration is 10 sec.
5.
Changing Animation Timing
1. Open can.ex2. Load all variables.
2.
3. View → Animation View
4. Change Mode to Real Time.
• Default animation duration is 10 sec.
5.
6. Change Duration to 60 sec.
7. again.
Smoothing the Animation
1. Make sure can.ex2 highlighted.
2. Filters → Temporal → Temporal
Interpolator
3.
4. Split view. Show can.ex2 in one
and TemporalInterpolator1 in the
other. Link the cameras.
5.
Adding Text Annotation
1. If you fell behind, you can reset
ParaView and reload can.ex2.
2. Sources → Text
3. Type a message in text edit box
4.
Text Position
Annotate Time
1. Sources → Annotate Time
2.
Annotate Time
1. Sources → Annotate Time
2.
3. Select can.ex2
4. From quick dialog, select Annotate
Time Filter
5.
6. Move annotation around.
Save Screenshot/Animation
1. Choose File → Save Screenshot
2. Complete the following dialogs.
3. Turn on Cube Axes around can.
4. Chose File → Export Scene
5. Complete the following dialogs.
6. Chose File → Save Animation
7. Complete the following dialogs.
Save Screenshot/Animation
1. Choose File → Save Screenshot
2. Complete the following dialogs.

3. Chose File → Save Animation


4. Complete the following dialogs.
Reset ParaView

Edit → Reset Session


Query-Based Selection
1. Open can.ex2. All variables.
2. Go to last time step.
3. Edit → Find Data.
4. Top combo box: find Cells.
5. Next row: EQPS, is >=, and 1.5.
6. Click Run Selection Query.
Query-Based Selection
Brush Selection
Surface Cell Selection Select Cells (polygon)
(shortcut: s)
Select Points (polygon)
Surface Point Selection
(shortcut: d) Block Selection
(shortcut: b)
Through Cell Selection
(shortcut: f) Interactively Select Cells

Through Point Selection Interactively Select Points


(shortcut: g) Hover Point Query
Selections
1. Open Find Data.
2. Make various brush selections.
3. Observe results in the Find Data
dialog box.
4. Play with the Invert Selection and
Show Frustum options.
Frustum vs. Id Selections
1. Make a Select Cells Through
2. Turn on Show Frustum in Find
Data. Rotate 3D view.
3. Play
4. Hit Freeze Selection in Find Data.
5. Play
Adding Labels
1. Go to the last time step.
2. Open Find Data.
3. Create query Global ID is min. Click
Run Selection Query.
4. In the Cell Labels chooser, select
EQPS.
Plot Selection Over Time
1. Open Find Data.
2. Create query EQPS is max. Click
Run Selection Query.
3. Click Plot Selection Over Time
4.
Reset ParaView

Edit → Reset Session


Extracting a Selection
1. Open can.ex2. Load all variables.
2. Perform a sizeable selection.
3. Add the extract selection filter.
4.
Reset ParaView

Edit → Reset Session


Make an Animation
1. Sources → Sphere,
2. Make animation view visible.
3. Change No. Frames to 50.
4. Select Sphere1, Start Theta, press
Make an Animation
1. Sources → Sphere,
2. Make animation view visible.
3. Change No. Frames to 50.
4. Select Sphere1, Start Theta, press
5. Double-click Sphere1 – Start Theta
6. Make New keyframe.
7. First keyframe value→360, second
keyframe time→0.5 value→0.
8. Click OK.
Animating Two Properties
1. Open Sphere1 – Start Theta.
2. Delete the first keyframe (at time 0).
3. Click OK.
4. Select Sphere1 – End Theta, press
5. Open Sphere1 – End Theta.
6. Change second key frame time to
0.5.
Camera Orbit
1. Place the camera where the orbit
should start.
2. Make animation view visible.
3. Select Camera – Orbit, press
4. Accept default values (click OK).
5.
Reset ParaView

Edit → Reset Session


Following Data
1. Open can.ex2. Load all variables.
2.
3. Make animation view visible.
4. Select Camera – Follow Data, press
5.
Batch Scripting
Python Batch Scripting
•Interpreter: Tools → Python Shell.
–Shell does tab completion and history.
–External programs pvpython and pvbatch.
–Can add bindings to external interpreters.
•Run Python scripts or bind to macros.
•Can trace actions or capture state.
•(Batch scripting is a different set of
bindings than programmable
sources/filters.)
Reset ParaView

Edit → Reset Session


Tracing ParaView State
1. Select Tools → Start Trace.
Python Tracing Options
Tracing ParaView State
1. Select Tools → Start Trace.
2. Accept defaults (click OK).
3. Build a simple pipeline (e.g. create a
sphere source and clip it).
4. Select Tools → Stop Trace.
5. An editing window will open.
Adding a Macro
1. In Python edit window menu, select
File → Save As Macro…
2. Chose a descriptive name. Save in
directory provided.
3. Close Python edit window.
4. Select Edit → Reset Session.
5. Activate your macro (on toolbar or
Macros menu).
Creating a Pipeline
• In Python Shell create a source
sphere = Sphere()
Show()
Render()
ResetCamera()
Creating a Pipeline
• In Python Shell create a source
sphere = Sphere()
Show()
Render()
ResetCamera()

• Then feed that into a filter


Hide()
shrink = Shrink()
Show()
Render()
Changing Properties
• Get listing of sphere’s properties
dir(sphere)

• Examine and then change one


print sphere.ThetaResolution
sphere.ThetaResolution = 16
Render()

• Change a different filter


shrink.ShrinkFactor = 0.25
Render()
Branching and Merging Pipeline
• Feed sphere’s output into a second filter
wireframe = ExtractEdges(
Input=sphere)
Show()
Render()

• Feed two filters into one


group = GroupDatasets(
Input=[shrink,wireframe])
Show()
Finding Pipeline Objects
•GetSources() Returns a list of objects
listed in the Pipeline Browser
•GetActiveSource() Returns the object
selected in the Pipeline Browser
•SetActiveSource() Sets the object
selected in the Pipeline Browser to the
given object
Reset ParaView

Edit → Reset Session


Reading Files
• Open a dataset.
reader = OpenDataFile('<path>/disk_out_ref.ex2')
Show()
Render()
ResetCamera()

• Use file browser to help identify <path>.


• Common locations:
– Mac: /Applications/ParaView-X.X..app/Contents/data
– Windows: C:/Program Files/ParaView X.X.X/data
– Linux: /usr/local/lib/paraview-X.X/data
Querying Attributes
• Examine all point data ranges
pd = reader.PointData
for ai in pd.values():
… print ai.GetName(),
… ai.GetNumberOfComponents(),
… for i in xrange(ai.GetNumberOfComponents()):
… print ai.GetRange(i),
… print
Coloring Data
• Get a hold of and manipulate display properties
readerRep = GetRepresentation()
readerRep.DiffuseColor = [0, 0, 1]
readerRep.SpecularColor = [1, 1, 1]
readerRep.SpecularPower = 128
readerRep.Specular = 1
Render()

• Now assign a color transfer function


ColorBy(readerRep, ('POINTS','Pres'))
UpdateScalarBars()
Render()
Controlling the View
Get a hold of, then manipulate view properties
view = GetActiveView()
view.Background = [0, 0, 0]
view.Background2 = [0, 0, 0.6]
view.UseGradientBackground = True
Render()
Save Results
Save Data
plot = PlotOverLine()
plot.Source.Point1 = [0,0,0]
plot.Source.Point2 = [0,0,10]
writer = CreateWriter('⟨path⟩/plot.csv')
writer.UpdatePipeline()

Then save screen capture of plot


plotView = CreateView('XYChartView')
Show(plot)
Render()
SaveScreenshot('<path>/plot.png')
Visualizing Large Models
Golevka Asteroid vs.
10 Megaton Explosion
•CTH shock physics, over 1 billion cells
Polar Vortex Breakdown
•SEAM Climate Modeling, 1 billion cells
(500 million cells visualized).
Objects-in-Crosswind Fire
•Coupled SIERRA/Fuego/Syrinx/Calore,
10 million unstructured hexahedra
Large Scale AMR
Wing with Unsteady Crossflow
from Synthetic Jet (3.3B tet)
Wake of Deflected Wing Flap
Data Parallel Pipelines
•Duplicate pipelines run independently
on different partitions of data.
Data Parallel Pipelines
•Duplicate pipelines run independently
on different partitions of data.
Data Parallel Pipelines
•Many operations will work regardless.
–Example: Clipping.
Data Parallel Pipelines
•Many operations will work regardless.
–Example: Clipping.
Data Parallel Pipelines
•Many operations will work regardless.
–Example: Clipping.

•Will discuss those that don’t later


Parallel Rendering
Parallel Rendering
Tiled Displays
ParaView Architecture
•Three tier
–Data Server
–Render Server
–Client
Standalone

Client

Data Render
Server Server
Client-Server

Data Render
Client
Server Server
Client-Render Server-Data Server

Data Render
Client
Server Server
How to Visualize Large Data?
•Run server on large machine
–Aggregate memory
–MPI for communication
Kitware binaries have MPI
but
not tuned to any particular machine
Microsoft MPI (free) not packaged
Requirements for
Installing ParaView Server
•C++
•CMake (www.cmake.org)
•MPI
•OpenGL (or Mesa3D www.mesa3d.org)
•Python +NumPy +Matplotlib (optional)
•Qt 4.7 (optional)
• http://www.paraview.org/Wiki/Setting_up_a_ParaView_Server#Compiling
Connecting to a ParaView Server

http://www.paraview.org/Wiki/Setting_up_a_ParaView_Server#Running_the_Server
Batch Parallel Processing
• parasphere.py paraview script
from paraview.simple import *
sphere = Sphere()
rep = Show()
ColorBy(rep, (’POINTS’, ’vtkProcessId’))
Render() rep.RescaleTransferFunctionToDataRange(True) Render()
WriteImage("parasphere.png")

• Run it in parallel
<path to>mpiexec -np 4 \
<path to>pvbatch parasphere.py
Batch Parallel Processing
• More generally
qsub -A <project to charge compute time to> \
-N <number of nodes> \
-n <number of processors on each node> \
mpiexec -np <N*n> \
pvbatch <arguments for pvbatch> \
script.py <arguments for Python script>

• Consult system administrators for syntax


Interactive Parallel Processing
• Run pvserver instead, but still in parallel
<path to>mpiexec -np 4 \
<path to>pvserver &

$ /Applications/paraview.app/Contents/MacOS/mpiexec -np 4 \
/Applications/paraview.app/Contents/bin/pvserver &
Waiting for client...
Connection URL: cs://kaltuel.local:11111
Accepting connection(s): kaltuel.local:11111
Interactive Parallel Processing
• Start ParaView GUI

• Connect

• Add Server
Interactive Parallel Processing
• Specify an TCP/IP path
• Just change nick name to “my computer” in this case

my computer
Interactive Parallel Processing
• pvserver already waiting, so keep Manual connection
Try a Remote Server Configuration
• Start ParaView GUI

• Connect

• Fetch Servers
Try a Remote Server Configuration

• Prerequisites on local machine:


– Windows - need Putty (i.e. ssh) for secure connection
– Mac - need XQuartz (i.e. X11) for login terminal
– Linux - typically OK but do know ‘which xterm’
Try a Remote Server Configuration

• Select one

• Import it
Try a Remote Server Configuration
• Click Connect then

• Configure session
– Local terminal and ssh exes
– ParaView version
– Remote username
– Number of nodes
– Amount of time
– Remote project
– Site specific options

• Click OK
Try a Remote Server Configuration
• Enter credentials

• Once logged in, wait for job to reach top of queue. 3D


View will return then.
• File -> Open, is remote system’s file system, otherwise
about the same as normal
Memory Inspector
Data Parallel Pipelines
•Some operations will have problems.
–Example: External Faces
Advanced Data Parallel Pipelines
•Some operations will have problems.
–Example: External Faces
Advanced Data Parallel Pipelines
•Ghost cells can solve most of these
problems.
Advanced Data Parallel Pipelines
•Ghost cells can solve most of these
problems.
Data Partitioning
•Partitions should be load balanced and
spatially coherent.
Data Partitioning
•Partitions should be load balanced and
spatially coherent.
Data Partitioning
•Partitions should be load balanced and
spatially coherent.
Load Balancing/Ghost Cells
•Automatic for Structured Meshes.
•Partitioning/ghost cells for unstructured
is “manual.”
•Use Ghost Level Generator to create
•Legacy option: D3. Also repartitions
Job Size Rules of Thumb
•Structured Data
–Try for max 20 M cell/processor.
–Shoot for 5 – 10 M cell/processor.
•Unstructured Data
–Try for max 1 M cell/processor.
–Shoot for 250 – 500 K cell/processor.
Avoiding Data Explosion
•Pipeline may cause data to be copied,
created, converted.
•This advice only for dealing with very
large amounts of data.
–Remaining available memory is low.
Topology Changing, No Reduction
• Append Datasets • Reflect
• Append Geometry • Rotational Extrusion
• Clean • Shrink
• Clean to Grid • Smooth
• Connectivity • Subdivide
• D3 • Tessellate
• Delaunay 2D/3D • Tetrahedralize
• Extract Edges • Triangle Strips
• Linear Extrusion • Triangulate
• Loop Subdivision
Topology Changing,
Moderate Reduction
• Clip • Extract Selection
• Decimate • Quadric Clustering
• Extract Cells by • Threshold
Region

Similar: Extract Subset


Topology Changing,
Dimension Reduction
• Cell Centers • Feature Edges
• Contour • Mask Points
• Extract CTH • Outline (curvilinear)
Fragments • Slice
• Extract CTH Parts • Stream Tracer
• Extract Surface
Adds Field Data
• Block Scalars • Octree Depth Limit
• Calculator • Octree Depth Scalars
• Cell Data to Point Data • Point Data to Cell Data
• Compute Derivatives • Process Id Scalars
• Curvature • Random Vectors
• Elevation • Resample with dataset
• Generate Ids • Surface Flow
• Gen. Surface Normals • Surface Vectors
• Gradient • Texture Map to…
• Level Scalars • Transform
• Median • Warp (scalar)
• Mesh Quality • Warp (vector)
Total Shallow Copy or
Output Independent of Input
• Annotate Time • Outline Corners
• Append Attributes • Plot Global Variables
• Extract Block Over Time
• Extract Datasets • Plot Over Line
• Extract Level • Plot Selection Over
• Glyph Time
• Group Datasets • Probe Location
• Histogram • Temporal Shift Scale
• Integrate Variables • Temporal Snap-to-
Time-Steps
• Normal Glyphs
• Temporal Statistics
• Outline
Special Cases
•Temporal Filters
–Temporal Interpolator
–Particle Tracer
–Temporal Cache
•Programmable Filter
Culling Data
•Reduce dimensionality early.
–Contour and slice “see” inside volumes.
•Prefer data reduction over extraction.
–Slice instead of Clip.
–Contour instead of Threshold.
•Only extract when reducing an order of
magnitude or more.
–Can still run into troubles.
Culling Data
•Experiment with subsampled data.
–Extract Subset
•Use caution.
–Subsampled data may be lacking.
–Use full data to draw final conclusions.
Resample To Image
•Structured Grid representations are
compact

•Efficiently copies values onto regular


grid

•Can downsample at same time


Resample To
Image
DIY2 handles
block data
transfer
Rendering Modes
•Still Render
–Full detail render.
•Interactive Render
–Sacrifices detail for speed.
–Provides quick rendering rate.
–Used when interacting with 3D view.
Level of Detail (LOD)
•Geometric decimation
•Used only with Interactive Render

Original Data Default Decimation Maximum Decimation


3D Rendering Parameters
Edit → Settings, Render View
Image Size LOD
•ParaView’s parallel rendering overhead
proportional to image size.
•Can use smaller images for interactive
rendering.

Original Data Subsample Rate: 2 pixels Subsample Rate: 4 pixels Subsample Rate: 8 pixels
Parallel Rendering Parameters
Edit → Settings, Render View
Parameters for Large Data
•Use display lists for GPU, off for CPU.
•Try outline instead of decimated
geometry.
–Also try lowering decimation factor.
•Avoid shipping large data back to client.
•Turn on subsampling.
•Image Compression on.
Parameters for Low Bandwidth
• Try larger subsampling rates.
•Try Zlib compression and fewer bits.
Parameters for High Latency
•Turn up Remote Render Threshold.
–Allow more data to go to client.
•Play with the LOD Threshold and LOD
Resolution to control geometry sent to
client.
•Turn on Use outline for LOD rendering if
decimated geometry too big for client.
•Try turning on interactive render delay.
Why In Situ?
System Parameter 2011 “2018” Factor
Change
System peak 2 PF 1 EF 500
Power 6 MW ≤20 MW 3
System Memory 0.3 PB 32-64 PB 33
Node Performance 0.125 Tf/s 1 TF 10 TF 8-80
Node Concurrency 12 1,000 10,000 83-830
Network BW 1.5 GB/s 100 GB/s 1,000 GB/s 66-660
System Size (nodes) 18,700 1M 100k 50
Total Concurrency 225 K 10 B 100 B 40k-400k
Storage Capacity 15 PB 300-1,000 PB 20-67
I/O BW 0.2 TB/s 20-60 TB/s 100-300

Source: “Scientific Discovery at the Exascale: Report from the DOE ASCR 2011 Workshop on Exascale Data Management, Analysis and Visualization.”
Why In Situ?
Need a supercomputer to analyze results from a hero run

2 orders of magnitude difference


between each level
In Situ Analysis and Visualization
Simulation

ParaView
Catalyst
Output
Processed
Data

Polygonal Output
with Field Data
Statistics
Series Data
Rendered Images
Reduced File IO Costs
Time of Type of Size per Size per Time per
Processin File File 1000 time File to
g steps Write at
Simulation

Post Restart 1,300 MB 1,300,000 MB 1-20


seconds
Post Ensight 200 MB 200,000 MB > 10
Dump seconds

In Situ PNG .25 MB 250 MB < 1 second

XRAGE (LANL) simulation


Access to More Data

Dump
Times
Post-processing In situ processing
CTH (Sandia) simulation with roughly equal data stored at simulation time

Reflections and shadows added in post-processing for both examples


Faster Time to Solution

CTH (Sandia) simulations comparing different workflows


Quick and Easy Run-Time Checks
Expected wind stress field at Wind stress in new run, quick
the surface of the ocean glance indicates using wrong wind
stress

MPAS-O (LANL) simulation


213
Small Run-Time Overhead

25
data generation
annotations
20
write
render
Seconds per Time Step

15

10

0
16 32 64 128 256 512 1024 2048

Cores

XRAGE (LANL) simulation


High Level View
Simulation Users Simulation Developers
• Knowledge of ParaView as • Pass necessary simulation
a post-processing/analysis data to ParaView Catalyst
tool • Need sufficient knowledge
– Basic interaction with GUI of both codes
Catalyst script generator
– VTK for grids and field data
plugin
– ParaView Catalyst libraries
– Incremental knowledge
increase to use the in situ • Transparent to simulation
tools from basic ParaView use users
• Programming knowledge • Extensible
can be useful to extend the
tools
In Situ Analysis and Visualization
Simulation
# Create the reader and set the filename.
reader = servermanager.sources.Reader(FileNames=path)
view = servermanager.CreateRenderView()
repr = servermanager.CreateRepresentation(reader, view)
reader.UpdatePipeline()
dataInfo = reader.GetDataInformation()
Augmented
pDinfo = dataInfo.GetPointDataInformation()
arrayInfo = pDInfo.GetArrayInformation("displacement9")
script in
Script Export if arrayInfo:
# get the range for the magnitude of displacement9
input deck.

ParaView
range = arrayInfo.GetComponentRange(-1)
lut = servermanager.rendering.PVLookupTable()
lut.RGBPoints = [range[0], 0.0, 0.0, 1.0,
range[1], 1.0, 0.0, 0.0]

Catalyst
lut.VectorMode = "Magnitude"
repr.LookupTable = lut
repr.ColorArrayName = "displacement9"
repr.ColorAttributeType = "POINT_DATA"

Output
Processed
Data

Polygonal Output
with Field Data
Statistics
Series Data
Rendered Images
In Situ Exercise
• $PVSOURCE/Examples/Catalyst/PythonFullExample
– fedriver.py - simulation main loop
– fedatastructures.py - toy simulation kernel on regular grid
– coprocessing.py - generic adaptor that runs catalyst scripts
– gridwriter.py - Catalyst script with simple pipeline to output full grid
– cpscript.py – Catalyst script with simple pipeline to output slices

• Run it in parallel
<path to>mpiexec -np 2 \
<path to>pvbatch --symmetric \
fedriver.py gridwriter.py

• Examine output with ParaView


<path to>paraview full_grid_0.pvti
ParaView GUI Plugin
• Creates Catalyst scripts (e.g. gridwriter.py) to insert
into simulation runs
• Mostly just use ParaView as normal
– Setup desired pipelines
– Ideally, start with a representative data set from
the simulation
• Plugin lets you add extra pipeline information to tell
what to take in and output during simulation run
– What will simulation produce?
– Add data extract writers
– Create screenshots to output
In Situ Exercise – Load Plugin
In Situ Exercise – New Menus
In Situ Exercise
• Bootstrap with some similar data
fedriver.py made fullgrid_*.pvti files
open one

• Customize the visualization pipeline for simulation


Produce different results
Almost anything ParaView can make is fair game
– Insert an Extract Subset Filter
– Insert a writer to have the simulation save its output
– Export View
– Save Script
In Situ Exercise – Adding in
Writers
• Only valid writers
available in Writers
menu
• Parameters:
– File Name – %t gets
replaced with time step
– Write Frequency
In Situ Exercise –
Exporting the Script
In Situ Exercise – Select Inputs
•Usually only a single input but can have
multiple inputs
•Each pipeline source is a potential input
In Situ Exercise – Specify Renderings
• Parameters/Options:
– Live visualization
– Rescale to Data
Range (all images)
– Individual images
• Image Type
• File Name
• Write Frequency
• Magnification
• Fit to Screen
• %t gets replaced
with time step
In Situ Exercise – Save the Script

•Click on Finish and save script


In Situ Exercise
• Run the simulation again
<path to>mpiexec -np 2 \
<path to>pvbatch --symmetric \
fedriver.py dataextracts.py

• It will produce requested data subsets and rendered


images
ParaView Catalyst Possibilities
• Just scratched the surface
– Don’t need ParaView GUI
– Don’t need Python
– Don’t need full ParaView library

– Can connect to running simulations


– Output Cinema databases for image based
deferred rendering interactive and queryable
visualization.
Want to Learn More?
• Catalyst User’s Guide:
– http://www.paraview.org/files/catalyst/docs/ParaVie
wCatalystUsersGuide_v2.pdf
• Website:
– http://catalyst.paraview.org
• Examples:
– In source code under the Examples/Catalyst
subdirectory.
– https://gitlab.kitware.com/paraview/paraview/tree/
master/Examples/Catalyst
Further Reading
•ParaView’s documentation page.
–http://www.paraview.org/documentation
•The ParaView User’s Guide
•http://www.paraview.org/Wiki/ParaView
• http://www.paraview.org/Wiki/Setting_up_a_ParaView_Server
Further Reading
Visualization and Customization
•Will Schroeder, Ken Martin, and Bill
Lorensen. The Visualization Toolkit.
Kitware, Inc., fourth edition, 2006.
•Kitware Inc. The VTK User’s Guide.
Kitware, Inc., 2006.
•Jasmin Blanchette and Mark
Summerfield. C++ GUI Programming
with Qt 4. Prentice Hall, 2006.
Further Reading
Parallel VTK Topics
• Kenneth Moreland. “A Survey of Visualization
Pipelines.” IEEE Transactions on Visualization and
Computer Graphics, 19(3), March 2013. DOI
10.1109/TVCG.2012.133.
• James Ahrens, Charles Law, Will Schroeder, Ken
Martin, and Michael Papka. “A Parallel Approach for
Efficiently Visualizing Extremely Large, Time-Varying
Datasets.” Technical Report #LAUR-00-1620, Los
Alamos National Laboratory, 2000.
• James Ahrens, Kristi Brislawn, Ken Martin, Berk
Geveci, C. Charles Law, and Michael Papka. “Large-
Scale Data Visualization Using Parallel Data
Streaming.” IEEE Computer Graphics and
Applications, 21(4): 34–41, July/August 2001.
Further Reading
Advanced Pipeline Execution
• Andy Cedilnik, Berk Geveci, Kenneth Moreland,
James Ahrens, and Jean Farve. “Remote Large
Data Visualization in the ParaView Framework.”
Eurographics Parallel Graphics and Visualization
2006, pg. 163–170, May 2006.
• James P. Ahrens, Nehal Desai, Patrick S. McCormic,
Ken Martin, and Jonathan Woodring. “A Modular,
Extensible Visualization System Architecture for
Culled, Prioritized Data Streaming.” Visualization
and Data Analysis 2007, Proceedings of SPIE-IS&T
Electronic Imaging, pg 64950I-1–12, January 2007.
• John Biddiscombe, Berk Geveci, Ken Martin,
Kenneth Moreland, and David Thompson. “Time
Dependent Processing in a Parallel Pipeline
Architecture.” IEEE Visualization 2007. October
2007.
Further Reading
Parallel Rendering
• Kenneth Moreland, Brian Wylie, and Constantine
Pavlakos. “Sort-Last Parallel Rendering for Viewing
Extremely Large Data Sets on Tile Displays.”
Proceedings of IEEE 2001 Symposium on Parallel
and Large-Data Visualization and Graphics, pg. 85–
92, October 2001.
• Kenneth Moreland and David Thompson. “From
Cluster to Wall with VTK.” Proceddings of IEEE 2003
Symposium on Parallel and Large-Data Visualization
and Graphics, pg. 25–31, October 2003.
• Kenneth Moreland, Lisa Avila, and Lee Ann Fisk.
“Parallel Unstructured Volume Rendering in
ParaView.” Visualization and Data Analysis 2007,
Proceedings of SPIE-IS&T Electronic Imaging, pg.
64950F-1–12, January 2007.

You might also like