Add Cool Visualizations Here Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary.

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

Pointers.
The C ++ Language BY Shery khan. The C++ Language Bjarne Stroupstrup, the language’s creator C++ was designed to provide Simula’s facilities for program.
Object-Oriented programming in C++ Classes as units of encapsulation Information Hiding Inheritance polymorphism and dynamic dispatching Storage management.
C++ Programming Languages
Chapter 5: Elementary Data Types Properties of types and objects –Data objects, variables and constants –Data types –Declarations –Type checking –Assignment.
Unstructured Data Partitioning for Large Scale Visualization CSCAPES Workshop June, 2008 Kenneth Moreland Sandia National Laboratories Sandia is a multiprogram.
CS 179: GPU Computing Lecture 2: The Basics. Recap Can use GPU to solve highly parallelizable problems – Performance benefits vs. CPU Straightforward.
6/10/2015C++ for Java Programmers1 Pointers and References Timothy Budd.
Chapter 10.
Data Parallel Algorithms Presented By: M.Mohsin Butt
The FFT on a GPU Graphics Hardware 2003 July 27, 2003 Kenneth MorelandEdward Angel Sandia National LabsU. of New Mexico Sandia is a multiprogram laboratory.
ARRAYS AND POINTERS Although pointer types are not integer types, some integer arithmetic operators can be applied to pointers. The affect of this arithmetic.
1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.
Templates. Objectives At the conclusion of this lesson, students should be able to Explain how function templates are used Correctly create a function.
Object-Oriented programming in C++ Classes as units of encapsulation Information Hiding Inheritance polymorphism and dynamic dispatching Storage management.
ECE122 L17: Method Development and Testing April 5, 2007 ECE 122 Engineering Problem Solving with Java Lecture 17 Method Development and Testing.
1 Procedural Concept The main program coordinates calls to procedures and hands over appropriate data as parameters.
CS0007: Introduction to Computer Programming Introduction to Arrays.
Differences between C# and C++ Dr. Catherine Stringfellow Dr. Stewart Carpenter.
Java Unit 9: Arrays Declaring and Processing Arrays.
Roadmap for Many-core Visualization Software in DOE Jeremy Meredith Oak Ridge National Laboratory.
“is a”  Define a new class DerivedClass which extends BaseClass class BaseClass { // class contents } class DerivedClass : BaseClass { // class.
BASE CLASSES AND INHERITANCE CHAPTER 4. Engineer Class.
Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation,
Dax: Rethinking Visualization Frameworks for Extreme-Scale Computing DOECGF 2011 April 28, 2011 Kenneth Moreland Sandia National Laboratories SAND P.
Data Structures Using C++ 2E
Operator Precedence First the contents of all parentheses are evaluated beginning with the innermost set of parenthesis. Second all multiplications, divisions,
Add Cool Visualizations Here Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary.
Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation,
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2009 Pearson Education, Inc., Upper.
Arrays Module 6. Objectives Nature and purpose of an array Using arrays in Java programs Methods with array parameter Methods that return an array Array.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Arrays Chapter 8. What if we need to store test scores for all students in our class. We could store each test score as a unique variable: int score1.
Generics and Collections. Introduction Generics New feature of J2SE 5.0 Provide compile-time type safety Catch invalid types at compile time Generic methods.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
We will talking about story of JAVA language. By Kristsada Songpartom.
C# Classes and Inheritance CNS 3260 C#.NET Software Development.
VTK-m Project Goals A single place for the visualization community to collaborate, contribute, and leverage massively threaded algorithms. Reduce the challenges.
 Genetic Algorithms  A class of evolutionary algorithms  Efficiently solves optimization tasks  Potential Applications in many fields  Challenges.
STK (Sierra Toolkit) Update Trilinos User Group meetings, 2014 R&A: SAND PE Sandia National Laboratories is a multi-program laboratory operated.
Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation,
Chapter 8 Class Inheritance and Interfaces F Superclasses and Subclasses  Keywords: super F Overriding methods  The Object Class  Modifiers: protected,
Introduction to Object-Oriented Programming Lesson 2.
Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Assignment 4 is due Nov. 20 (next Friday). After today you should know everything you need for assignment.
Programmeren 1 6 september 2010 HOORCOLLEGE 2: INTERACTIE EN CONDITIES PROGRAMMEREN 1 6 SEPTEMBER 2009 Software Systems - Programming - Week.
ICOM 4035 – Data Structures Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 – August 23, 2001.
Lecture 7 February 24, Javadoc version and author Tags These go in the comments before named classes. –Put your SS# on a separate line from the.
CSE 143 Lecture 4 More ArrayIntList : Pre/postconditions; exceptions; testing reading: slides created by Marty Stepp and Hélène Martin
Introduction to CUDA 1 of 2 Patrick Cozzi University of Pennsylvania CIS Fall 2014.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
Arrays Chapter 7. MIS Object Oriented Systems Arrays UTD, SOM 2 Objectives Nature and purpose of an array Using arrays in Java programs Methods.
Add Cool Visualizations Here Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary.
Object-Oriented programming in C++ Classes as units of encapsulation Information Hiding Inheritance polymorphism and dynamic dispatching Storage management.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION SYMBOLIC TESTING Autumn 2011.
Adapting the Visualization Toolkit for Many-Core Processors with the VTK-m Library Christopher Sewell (LANL) and Robert Maynard (Kitware) VTK-m Team: LANL:
Chapter 9 Introduction to Arrays Fundamentals of Java.
Performing Fault-tolerant, Scalable Data Collection and Analysis James Jolly University of Wisconsin-Madison Visualization and Scientific Computing Dept.
Problem of the Day  Why are manhole covers round?
GPU Acceleration of Particle-In-Cell Methods B. M. Cowan, J. R. Cary, S. W. Sides Tech-X Corporation.
BIL 104E Introduction to Scientific and Engineering Computing Lecture 4.
Modern Programming Tools And Techniques-I
Java Programming Language
Dynamic Parallelism Martin Kruliš by Martin Kruliš (v1.0)
Section 11.1 Class Variables and Methods
CS212: Object Oriented Analysis and Design
Ray-Cast Rendering in VTK-m
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
Kenneth Moreland Edward Angel Sandia National Labs U. of New Mexico
Corresponds with Chapter 5
Presentation transcript:

Add Cool Visualizations Here 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 NO PE VTK-m Overview NVIDIA Design Review

VTK-m Combining Dax, PISTON, EAVL

Execution Environment Control Environment VTK-m Framework vtkm::contvtkm::exec

Execution Environment Control Environment Grid Topology Array Handle Invoke VTK-m Framework vtkm::contvtkm::exec

Execution Environment Cell Operations Field Operations Basic Math Make Cells Control Environment Grid Topology Array Handle Invoke Worklet VTK-m Framework vtkm::contvtkm::exec

Execution Environment Cell Operations Field Operations Basic Math Make Cells Control Environment Grid Topology Array Handle Invoke Worklet VTK-m Framework vtkm::contvtkm::exec

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 vtkm::contvtkm::exec

Device Adapter Contents  Tag ( struct DeviceAdapterFoo { }; )  Execution Array Manager  Schedule  Scan  Sort  Other Support algorithms  Stream compact, copy, parallel find, unique Control EnvironmentExecution Environment Transfer functor worklet functor Schedule Compute

Device Adapter Contents  Tag ( struct DeviceAdapterFoo { }; )  Execution Array Manager  Schedule  Scan  Sort  Other Support algorithms  Stream compact, copy, parallel find, unique Control EnvironmentExecution Environment Transfer functor worklet functor Schedule Compute thrust has nice 1D array index map could really use a 3D array index map

Array Handle

Array Handle Storage Array of Structs Storage

Array Handle Storage Array of Structs Storage x0x0 x1x1 x2x2 Struct of Arrays Storage y0y0 y1y1 y2y2 z0z0 z1z1 z2z2

Array Handle Storage Array of Structs Storage x0x0 x1x1 x2x2 Struct of Arrays Storage y0y0 y1y1 y2y2 z0z0 z1z1 z2z2 vtkCellArray Storage

Fancy Array Handles Constant Storage c Uniform Point Coord Storage f(i,j,k) = [o x + s x i, o y + s y j, o z + s z k] Permutation Storage

Array Handle Resource Management Control Environment Array Handle Storage Contains Uses

Array Handle Resource Management Control Environment Execution Environment Device Adapter Transfer Array Handle Storage Contains Uses Implements

Array Handle Resource Management Control Environment Execution Environment Device Adapter Transfer Array Handle Storage Contains Uses Implements f(x)

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } }; Execution Environment Control Environment vtkm::cont::ArrayHandle inputHandle = vtkm::cont::make_ArrayHandle(input); vtkm::cont::ArrayHandle sineResult; vtkm::worklet::DispatcherMapField dispatcher; dispatcher.Invoke(inputHandle, sineResult);

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } }; Execution Environment Control Environment vtkm::cont::ArrayHandle inputHandle = vtkm::cont::make_ArrayHandle(input); vtkm::cont::ArrayHandle sineResult; vtkm::worklet::DispatcherMapField dispatcher; dispatcher.Invoke(inputHandle, sineResult);

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } }; Execution Environment Control Environment vtkm::cont::ArrayHandle inputHandle = vtkm::cont::make_ArrayHandle(input); vtkm::cont::ArrayHandle sineResult; vtkm::worklet::DispatcherMapField dispatcher; dispatcher.Invoke(inputHandle, sineResult);

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } }; Execution Environment Control Environment vtkm::cont::ArrayHandle inputHandle = vtkm::cont::make_ArrayHandle(input); vtkm::cont::ArrayHandle sineResult; vtkm::worklet::DispatcherMapField dispatcher; dispatcher.Invoke(inputHandle, sineResult);

struct Sine: public vtkm::worklet::WorkletMapField { typedef void ControlSignature(FieldIn<>, FieldOut<>); typedef _2 ExecutionSignature(_1); template VTKM_EXEC_EXPORT T operator()(T x) const { return vtkm::math::Sin(x); } };

struct Zip2: public vtkm::worklet::WorkletMapField { typedef void ControlSignature( FieldIn, FieldOut ); typedef void ExecutionSignature(_1, _2, _3); typedef VTKM_EXEC_EXPORT void operator()(T1 x, T2 y, V &result) const { result = V(x, y); } };

struct ImagToPolar: public vtkm::worklet::WorkletMapField { typedef void ControlSignature( FieldIn, FieldOut, FieldOut ); 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); } };

struct Advect: public vtkm::worklet::WorkletMapField { typedef void ControlSignature( FieldIn, FieldOut, FieldOut ); typedef void ExecutionSignature( _1, _2, _3, _4, _5, _6, _7); template VTKM_EXEC_EXPORT void operator()(T1 startPosition, T2 startVelocity, T3 acceleration, T4 &endPosition, T5 &endVelocity, T6 &rotation, T7 &angularVelocity) const {... } };

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 Specified by signature tags

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 dispatcher; dispatcher.Invoke(inputHandle, sineResult);

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 dispatcher; dispatcher.Invoke(inputHandle, sineResult); DynamicArrayHandle

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 dispatcher; dispatcher.Invoke(inputHandle, sineResult); ArrayHandle

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 dispatcher; dispatcher.Invoke(inputHandle, sineResult); ArrayHandle

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 dispatcher; dispatcher.Invoke(inputHandle, sineResult); ArrayHandle = 10,000

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 dispatcher; dispatcher.Invoke(inputHandle, sineResult); ArrayPortal = 10,000

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 dispatcher; dispatcher.Invoke(inputHandle, sineResult); ArrayPortal = 10,000

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 dispatcher; dispatcher.Invoke(inputHandle, sineResult); ArrayPortal = 10,000 arg1 = 1.57 arg2

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 dispatcher; dispatcher.Invoke(inputHandle, sineResult); ArrayPortal = 10,000 = worklet( ); arg1 = 1.57 arg2

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 dispatcher; dispatcher.Invoke(inputHandle, sineResult); ArrayPortal = 10,000 = worklet( ); arg1 = 1.57arg2 = 1

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 dispatcher; dispatcher.Invoke(inputHandle, sineResult); ArrayPortal = 10,000 arg1 = 1.57arg2 = 1

Reporting Errors in Worklets  Exceptions cannot be thrown in the execution environment  Not supported in CUDA. Problematic with multiple threads.  All worklets have a method named RaiseError  Call this method with a message string.  In the control environment, a vtkm::cont::ErrorExecution will be thrown with the given message  Behaves as if the error was thrown in the worklet  Be aware, raising an error might not actually halt any execution. VTKM_EXEC_EXPORT T operator()(T x) const { if (x < 0) { this->RaiseError("Cannot take square root of negative number."); } return vtkm::math::Sqrt(x); }

How interop worked in Dax  #include  Use dax::opengl::TransferToOpenGL to create an OpenGL buffer object containing the same data as an ArrayHandle  Does the right thing regardless of CUDA or some other backend DAX_CONT_EXPORT void BindPointCoordinates( dax::cont::ArrayHandle pointArray) { GLuint oglPointBuffer; glGenBuffers(1, &oglPointBuffer); dax::opengl::TransferToOpenGL(pointArray, oglPointBuffer); glEnableClientState(GL_VERTEX_ARRAY); glBindBuffer(GL_ARRAY_BUFFER, oglPointBuffer); glVertexPointer(3, GL_FLOAT, 0, NULL); }

Explicit Connectivity Data Set  First pass at a data set (to be one of several)  Still a work in progress  Simple implementation  Arrays transport themselves to execution environment class ExplicitConnectivity { public: // Helper methods... ArrayHandle Shapes; ArrayHandle NumIndices; ArrayHandle Connectivity; ArrayHandle MapCellToConnectivityIndex; };

Explicit Connectivity Data Set TETRA HEDAHEDRON WEDGE HEXAHEDRON TETRA ShapesNum Indices Map Cell to Connectivity

Explicit Connectivity Open Questions  How should zoo elements be handled in CUDA threads  Solution 1: Use runtime conditions  How well will CUDA handle conditional methods/looping  If all threads have the same cell shape?  If all threads have different cell shapes?  What is the best way to branch conditional code (like interpolation)?  Case statement? If/else clauses? Virtual methods?  Solution 2: Reorder cells to collect by cell type. Execute each cell type in different kernel  Potentially removes branching, but adds large overhead on reordering cells  Does not help for random access search structures  Should there be a specialized unstructured grid of uniform type?  Probably depends on how well general structure works with single type

Explicit Connectivity Open Questions  Could streaming ever work?  Streaming Shapes, NumIndices, and MapCellToConnectivityIndex straightforward  Streaming Connectivity array tricky  How can you stream point field information  Could be the lion’s share of data  Will upcoming CUDA features solve any of these problems for us?

Other Questions  Runtime polymorphic types  We jump through a lot of hoops to statically type everything in a device kernel  How necessary is this in the latest CUDA architecture  Would we be just as good calling a virtual method to load/store every datum?  We would still need to resolve to core types (bad to have to convert everything to double)  Would that typing be better inside or outside the kernel?