SLIDE 1 Robert Maynard Marcus D. Hanwell
GTC, San Jose, CA March, 2015
1
In-Situ Data Analysis and Visualization: ParaView, Calalyst and VTK-m
SLIDE 2 Agenda
- Introduction to ParaView Catalyst
- Run example Catalyst Script
- Creating your own Catalyst Script
- Rendering grid and field information from
live simulation
2
SLIDE 3 Going From Data to Visualization
3
SLIDE 4 The Visualization Pipeline
- A sequence of algorithms that operate on
data objects to generate geometry
4
Source Data Data Filter Filter Data Data Mapper Mapper Actor Actor
Render on screen
SLIDE 5 Data Types
Uniform Rectilinear (vtkImageData) Non-Uniform Rectilinear (vtkRectilinearData) Curvilinear (vtkStructuredData) Polygonal (vtkPolyData) Unstructured Grid (vtkUnstructuredGrid)
Multi-block
Hierarchical Adaptive Mesh Refinement (AMR) Hierarchical Uniform AMR
SLIDE 6 Why In Situ?
6
Need a supercomputer to analyze results from a hero run 2 orders of magnitude difference between each level
SLIDE 7 Access to More Data
7
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
Dump Times
SLIDE 8
Quick and Easy Run-Time Checks
MPAS-O (LANL) simulation
SLIDE 9 Faster Time to Solution
CTH (Sandia) simulations comparing different workflows
9
SLIDE 10 5 10 15 20 25 16 32 64 128 256 512 1024 2048
Seconds per Time Step Cores data generation annotations write render cell to point contour
Small Run-Time Overhead
XRAGE (LANL) simulation
10
SLIDE 11 Reduced File IO Costs
Time of Processing Type of File Size per File Size per 1000 time steps Time per File to Write at Simulation Post Restart 1,300 MB 1,300,000 MB 1-20 seconds Post Ensight Dump 200 MB 200,000 MB > 10 seconds In Situ PNG .25 MB 250 MB < 1 second
XRAGE (LANL) simulation
11
SLIDE 12 What is ParaView Catalyst?
12
SLIDE 13 ParaView Catalyst Architecture
ParaView Catalyst Python Wrappings
ParaView Server
Parallel Abstractions and Controls
VTK
Core Visualization Algorithms
13
SLIDE 14 ParaView User Interface
Menu Bar Toolbars Pipeline Browser Properties Panel 3D View Advanced Toggle
SLIDE 15 Geometry Representations
Points Wireframe Surface Surface with Edges Volume
Toggle Color Legend Mapped Variable Representation Vector Component Edit Colors Reset Scalar Range Custom Scalar Range
SLIDE 16 Simulation Disk Storage Visualization Simulation Disk Storage Visualization
Separate MPI
Running Simulation with Catalyst
In Situ In Transit
16
SLIDE 17 Running Simulation with Catalyst
Today we are going to be running In Situ and interactively with Catalyst
17
Simulation Visualization
SLIDE 18 Simulation
Polygonal Output with Field Data Script Export Augmented script in input deck. Rendered Images 18
# Create the reader and set the filename. reader = sm.sources.Reader(FileNames=path) view = sm.CreateRenderView() repr = sm.CreateRepresentation(reader, view) reader.UpdatePipeline() dataInfo = reader.GetDataInformation() pinfo = dataInfo.GetPointDataInformation() arrayInfo = pInfo.GetArrayInformation( "displacement9")
Output Processed Data
User Perspective
Series Data
SLIDE 19 GETTING READY TO RUN INTERACTIVELY
19
SLIDE 20 Two Ways for Live In Situ Analysis and Visualization
– Simulation proceeds while the user interacts with the data from a specific time step – “At scale” mode
- With blocking (new in ParaView 4.2)
– Simulation is blocked while the user interacts with the data – “Debugging” mode
- Can switch between interactive and batch during run as well as
disconnecting from the run
20
SLIDE 21 Getting Ready to Run Interactively
- From the command shell run
– “~/insitu_demo/demo1.sh”
- This runs a fake simulation with a prebuilt
catalyst pipeline
21
SLIDE 22 Run Interactively
Load ParaView and connect to the simulation
22
SLIDE 23 Run Interactively
23
Enable Extraction of Contour Visualize the Contour
SLIDE 24 Run Interactively
24
SLIDE 25 CREATING CATALYST OUTPUT
25
SLIDE 26 Creating Catalyst Output
- ParaView GUI plugin to create Python
scripts
- Developer generated “canned” scripts
– See ParaView Catalyst User’s Guide
26
SLIDE 27 Create Python Scripts from ParaView
Load the Catalyst script generator GUI plugin
27
SLIDE 28 Create Python Scripts from ParaView
Load File
~/Demo2/filename_20_0.vti
Create Contour Filter
28
SLIDE 29 29
Create Python Scripts from ParaView
Using the Writers menu add a writer
SLIDE 30 30
Create Python Scripts from ParaView
- 1. Load the Catalyst script generator GUI plugin
- 2. Load File
- 3. Create Contour Filter
- 4. Using the Writers menu add a writer
SLIDE 31 31
Export Catalyst Live Script
Using the CoProcessing menu start the export process
SLIDE 32 32
Export Catalyst Live Script
- 1. Using the CoProcessing menu start the export
process
- 2. Select ‘filename_20_0.pvti’ as the simulation
inputs
- 3. Select Live Visualization
SLIDE 33 Other Catalyst Export Options
– Live visualization – Output to Cinema – Output Views
33
SLIDE 34 Other Catalyst Export Options
– Image Type – File Name – Write Frequency – Magnification – Fit to Screen – %t for timestep
34
SLIDE 35 Other Catalyst Export Options
– Static vs Spherical Camera
35
Θ φ
SLIDE 36 GETTING READY TO RUN OUR SCRIPT
36
SLIDE 37 Getting Ready to Run Interactively
- run ~/insitu_demo/demo2.sh
We are running our premade python script, if you want to run the version you made change driver_path variable in demo2.sh
37
SLIDE 38 Run Interactively
Load ParaView and connect to the simulation
38
SLIDE 39 Run Interactively ( Update with new Images)
39
Enable Extraction of Contour Visualize the Contour
SLIDE 40 Developers Section Overview
- Most work is done in creating the adaptor between the
simulation code and Catalyst
- Small footprint in main simulation code base
- Needs to be efficient both in memory and computationally
- Fortran, C++ and Python examples:
– https://github.com/Kitware/ParaViewCatalystExampleCode
40
SLIDE 41 Interaction Overview
- Simulation has separate data structures from
VTK data structures
- Use an adaptor to bridge the gap
– Try to reuse existing memory – Also responsible for other interactions between simulation code and Catalyst
Solver Adaptor
41
SLIDE 42 Developer Perspective
Simulation
42
Adaptor
INITIALIZE(in pipelines) COPROCESS(in time, in grid, in fields) FINALIZE()
INITIALIZE() ADDPIPELINE(in pipeline) REQUESTDATADESCRIPTION(in time,
COPROCESS(in vtkDataSet) FINALIZE()
SLIDE 43 Online Help
- ParaView Catalyst User’s Guide:
– http://paraview.org/Wiki/images/4/48/CatalystUsersGuide.pdf
– paraview@paraview.org
– http://www.vtk.org/doc/nightly/html/classes.html – http://www.paraview.org/ParaView3/Doc/Nightly/html/classes.html
– http://www.paraview.org/ParaView3/Doc/Nightly/www/py-doc/index.html
– http://www.paraview.org – http://www.paraview.org/in-situ/
– https://github.com/Kitware/ParaViewCatalystExampleCode
43
SLIDE 44 VTK-m Project Goals
- A single place for the visualization community to
collaborate, contribute, and leverage massively threaded algorithms.
- Reduce the challenges of writing highly
concurrent algorithms by using data parallel algorithms
SLIDE 45 VTK-m Architecture
In-Situ
Execution
Data Parallel Algorithms
Arrays
Post Processing
Worklets
DataModel
Filters
- Combines strengths of multiple projects:
– EAVL, Oak Ridge National Laboratory – DAX, Sandia National Laboratory – PISTON, Los Alamos National Laboratory
SLIDE 46 Execution Environment
Cell Operations Field Operations Basic Math Make Cells
Control Environment
Grid Topology Array Handle Invoke
Device Adapter
Allocate Transfer Schedule Sort …
Worklet
VTK-m Framework
cont exec
SLIDE 47 VTK-m Arbitrary Composition
- VTK-m allows clients to access different memory layouts through the
Array Handle and Dynamic Array Handle. –Allows for efficient in-situ integration –Allows for reduced data transfer
Control Environment Execution Environment
Transfer
Control Environment Execution Environment
SLIDE 48
struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };
SLIDE 49
struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };
SLIDE 50
struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };
SLIDE 51
struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };
SLIDE 52
struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };
SLIDE 53
struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };
SLIDE 54
struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };
SLIDE 55 struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };
Execution Environment Control Environment
vtkm::cont::ArrayHandle<vtkm::Float32> inputHandle = vtkm::cont::make_ArrayHandle(input); vtkm::cont::ArrayHandle<vtkm::Float32> sineResult; vtkm::worklet::DispatcherMapField<Sine> dispatcher; dispatcher.Invoke(inputHandle, sineResult);
SLIDE 56 struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } }; vtkm::cont::ArrayHandle<vtkm::Float32> inputHandle = vtkm::cont::make_ArrayHandle(input); vtkm::cont::ArrayHandle<vtkm::Float32> sineResult; vtkm::worklet::DispatcherMapField<Sine> dispatcher; dispatcher.Invoke(inputHandle, sineResult);
Execution Environment Control Environment
SLIDE 57 struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } }; vtkm::cont::ArrayHandle<vtkm::Float32> inputHandle = vtkm::cont::make_ArrayHandle(input); vtkm::cont::ArrayHandle<vtkm::Float32> sineResult; vtkm::worklet::DispatcherMapField<Sine> dispatcher; dispatcher.Invoke(inputHandle, sineResult);
Execution Environment Control Environment
SLIDE 58 struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } }; vtkm::cont::ArrayHandle<vtkm::Float32> inputHandle = vtkm::cont::make_ArrayHandle(input); vtkm::cont::ArrayHandle<vtkm::Float32> sineResult; vtkm::worklet::DispatcherMapField<Sine> dispatcher; dispatcher.Invoke(inputHandle, sineResult);
Execution Environment Control Environment
SLIDE 59
struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template<typename T> VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };
SLIDE 60 Dispatcher Invoke Operations
- Convert polymorphic types to static types
- Check types
- Dispatcher-specific operations
– Find domain length – Build index arrays
- Transport data from control to execution
- Run worklet invoke kernel
- Fetch thread-specific data
- Invoke worklet
- Push thread-specific data
DispatcherMapField<Sine> dispatcher; dispatcher.Invoke(inputHandle, sineResult);
SLIDE 61 struct ImagToPolar: public vtkm::worklet::WorkletMapField { typedef void ControlSignature( FieldIn<vtkm::TypeListTagScalar>, FieldIn<vtkm::TypeListTagScalar>, FieldOut<vtkm::TypeListTagScalar>, FieldOut<vtkm::TypeListTagScalar>); typedef void ExecutionSignature(_1, _2, _3, _4); template<typename RealType, typename ImaginaryType, typename MagnitudeType, typename PhaseType> VTKM_EXEC_EXPORT void operator()(RealType real, ImaginaryType imag, MagnitudeType &magnitude, PhaseType &phase) const { magnitude = vtkm::math::Sqrt(real*real + imag*imag); phase = vtkm::math::ATan2(imaginary, real); } };
SLIDE 62 What We Have So Far
– Statically and Dynamically Typed Arrays – Device Interface (Serial, Cuda, TBB under development) – Basic Worklet and Dispatcher
SLIDE 63 What We Have So Far
– gcc (4.8+), clang, msvc (2010+), icc, and pgi
- User Guide
- Ready for larger collaboration
SLIDE 64 Thank You!
Marcus D. Hanwell
- mhanwell@kitware.com
- @mhanwell
- +MarcusHanwell
Robert Maynard
- robert.maynard@kitware.com
- @robertjmaynard
64
Please complete the Presenter Evaluation sent to you by email or through the GTC Mobile App. Your feedback is important!
Checkout out Kitware @ www.kitware.com and ParaView @ www.paraview.org