Technische Universität München Peano 2. Technische Universität München Peano 2, Jun Features of Peano Adaptive Cartesian Grids –Arbitrary.

Slides:



Advertisements
Similar presentations
Technische Universität München KONWIHR II – Computational Steering Miriam Mehl Juni 2009.
Advertisements

Lists and the Collection Interface Chapter 4. Chapter Objectives To become familiar with the List interface To understand how to write an array-based.
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
An Eulerian Divergence Preserving Approach for Partitioned FSI Simulations on Cartesian Grids M. Mehl, M. Brenk, I. Muntean, T. Neckel, T. Weinzierl TU.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Efficient Storage and Processing of Adaptive Triangular Grids using Sierpinski Curves Csaba Attila Vigh Department of Informatics, TU München JASS 2006,
SKELETON BASED PERFORMANCE PREDICTION ON SHARED NETWORKS Sukhdeep Sodhi Microsoft Corp Jaspal Subhlok University of Houston.
Dynamic adaptation of parallel codes Toward self-adaptable components for the Grid Françoise André, Jérémy Buisson & Jean-Louis Pazat IRISA / INSA de Rennes.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Technische Universität München Benefits of Structured Cartesian Grids for the Simulation of Fluid- Structure Interactions Miriam Mehl Department of Computer.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. ETC - 1 What comes next? Recursion (Chapter 15) Recursive Data Structures.
Cache-Optimal Parallel Solution of PDEs Ch. Zenger Informatik V, TU München Finite Element Solution of PDEs Christoph Zenger Nadine Dieminger, Frank Günther,
ISBN Lecture 01 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Lecture 01 Topics Motivation Programming.
Abstract Data Types and Encapsulation Concepts
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Parallel Adaptive Mesh Refinement Combined With Multigrid for a Poisson Equation CRTI RD Project Review Meeting Canadian Meteorological Centre August.
Eclipse – making OOP Easy
A Parallelisation Approach for Multi-Resolution Grids Based Upon the Peano Space-Filling Curve Student: Adriana Bocoi Advisor: Dipl.-Inf.Tobias Weinzierl.
1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17.
Page 1 JASS 2004 Tobias Weinzierl Sophisticated construction ideas of ansatz- spaces How to construct Ritz-Galerkin ansatz-spaces for the Navier-Stokes.
JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Issues in (Financial) High Performance Computing John Darlington Director Imperial College Internet Centre Fast Financial Algorithms and Computing 4th.
Andrew S. Budarevsky Adaptive Application Data Management Overview.
Chapter 8 Object Design Reuse and Patterns. Object Design Object design is the process of adding details to the requirements analysis and making implementation.
Copyright © 2012 Pearson Education, Inc. Chapter 9 Classes and Multiform Projects.
Design Issues. How to parallelize  Task decomposition  Data decomposition  Dataflow decomposition Jaruloj Chongstitvatana 2 Parallel Programming: Parallelization.
Framework for MDO Studies Amitay Isaacs Center for Aerospace System Design and Engineering IIT Bombay.
Information System Design (IT60105) Lecture 26 Object-Oriented System Testing.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
Object Oriented Software Development
1 1 What does Performance Across the Software Stack mean?  High level view: Providing performance for physics simulations meaningful to applications 
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
Software Design: Principles, Process, and Concepts Getting Started with Design.
Abstraction ADTs, Information Hiding and Encapsulation.
Domain Decomposition in High-Level Parallelizaton of PDE codes Xing Cai University of Oslo.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
FALL 2015 Esra Sorgüven Öner
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
1 Data Structures for Scientific Computing Orion Sky Lawlor /04/14.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
FUNCTIONS (C) KHAERONI, M.SI. OBJECTIVE After this topic, students will be able to understand basic concept of user defined function in C++ to declare.
Technische Universität München © Prof. Dr. H. Krcmar An Ontology-based Platform to Collaboratively Manage Supply Chains Tobias Engel, Manoj Bhat, Vasudhara.
Classes CS 162 (Summer 2009). Parts of a Class Instance Fields Methods.
OOP - Object Oriented Programming
Review of last class Software Engineering Modeling Problem Solving
Department of Computer Science, TU München
Xing Cai University of Oslo
The Movement To Objects
PLM, Document and Workflow Management
Abstract Data Types and Encapsulation Concepts
Self Healing and Dynamic Construction Framework:
Data Structures for Efficient and Integrated Simulation of Multi-Physics Processes in Complex Geometries A.Smirnov MulPhys LLC github/mulphys
Activities and Intents
Knowledge Representation
Chapter 5 - Functions Outline 5.1 Introduction
Abstract Data Types and Encapsulation Concepts
Chap. 8 :: Subroutines and Control Abstraction
Chap. 8 :: Subroutines and Control Abstraction
Efficient Parallel Simulation of Fluid Dynamics on Cartesian Grids
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
Object Oriented Programming
GENERAL VIEW OF KRATOS MULTIPHYSICS
Metadata Framework as the basis for Metadata-driven Architecture
Ph.D. Thesis Numerical Solution of PDEs and Their Object-oriented Parallel Implementations Xing Cai October 26, 1998.
Implementation Plan system integration required for each iteration
Presentation transcript:

Technische Universität München Peano 2

Technische Universität München Peano 2, Jun Features of Peano Adaptive Cartesian Grids –Arbitrary adaptivity –Arbitrary dimensions (2D/3D/...) –Dynamic refinement & coarsening –Multiscale representation Memory Behaviour –Very low memory requirements –Good cache behaviour Parallelisation –Shared and/or distributed –memory parallelisation –Domain decomposition model –In this presentation, we dicuss how to exploit these features.

Technische Universität München Peano 2, Jun Agenda Peano's Principles – k-spacetrees – Grid traversal & call-back mechanism Peano Architecture – Philosophy and terminology – T-Architecture – Unit tests – Configuration files – Grid setup PeProt: Automatic Code Generation – Model the degrees of freedom – Introducing behaviour

Technische Universität München Peano 2, Jun k-Spacetrees Generalisation of Octrees Construction –Embed domain into unit square (domain) –Refine unit square: Domain is contained in central element –Continue recursively –Store only tree Remarks –Any dimension supported –k=3 for Peano space-filling curve –Low memory requirements –Multiple vertices at same position –Hanging nodes

Technische Universität München Peano 2, Jun k-Spacetrees Generalisation of Octrees Construction –Embed domain into unit square (domain) –Refine unit square: Domain is contained in central element –Continue recursively –Store only tree Remarks –Any dimension supported –k=3 for Peano space-filling curve –Low memory requirements –Multiple vertices at same position –Hanging nodes

Technische Universität München Peano 2, Jun k-Spacetrees Generalisation of Octrees Construction –Embed domain into unit square (domain) –Refine unit square: Domain is contained in central element –Continue recursively –Store only tree Remarks –Any dimension supported –k=3 for Peano space-filling curve –Low memory requirements –Multiple vertices at same position –Hanging nodes

Technische Universität München Peano 2, Jun k-Spacetrees Generalisation of Octrees Construction –Embed domain into unit square (domain) –Refine unit square –Continue recursively –Store only tree Remarks –Any dimension supported –k=3 for Peano space-filling curve –Low memory requirements –Multiple vertices at same position –Hanging nodes

Technische Universität München Peano 2, Jun Grid Traversal Traversal Paradigms –Each solver has to run over grid –Iterator concept (for loop) vs. –call-back mechanism Call-back with Traversal Events –How-to traverse is encapsulated –Where to go next is encapsulated –Each grid transition triggers event –User can plug into events Limitations –Never traverse subsets of grid –User can’t control traversal direction –or behaviour, but –complexity of traversal is hidden and –it might run in parallel. Transition triggers an event

Technische Universität München Peano 2, Jun Grid Traversal Traversal Paradigms –Each solver has to run over grid –Iterator concept (for loop) vs. –call-back mechanism Call-back with Traversal Events –How-to traverse is encapsulated –Where to go next is encapsulated –Each grid transition triggers event –User can plug into events Limitations –Never traverse subsets of grid –User can’t control traversal direction –or behaviour, but –complexity of traversal is hidden and –it might run in parallel. Transition triggers an event, and this Event is mapped to (several) event handles – the user-defined functions void touchVertexFirstTime( Vertex &vertex) { […] vertex.refine(); […] }

Technische Universität München Peano 2, Jun Agenda Peano's Principles – k-spacetrees – Grid traversal & call-back mechanism Peano Architecture – Philosophy and terminology – T-Architecture – Unit tests – Configuration files – Grid setup PeProt: Automatic Code Generation – Model the degrees of freedom – Introducing behaviour

Technische Universität München Peano 2, Jun Peano Architecture

Technische Universität München Peano 2, Jun Peano – Philosophy and Terminology Philosophy –Algorithm = sequence of phases (implemented in runner) –Phase consists of every computing node receives global state, grid is traversed once (in parallel), and global state is reduced. Repository –Repository = big box hiding Peano kernel and phase management –Single point of contact for algorithm (SPoC) –Two types of operations: iterate() and switchToPhaseXXX()

Technische Universität München Peano 2, Jun What happens when I call iterate()? Terminology & Concept –Repository tells grid to traverse with automaton –Transition of automaton triggers event –Users can plug into events, i.e. behaviour is mapping from events to operations –Algorithm selects phase, i.e. a set of mappings to apply to traversal –Such a combination is an adapter What defines a Peano Application? –Data stored on the grid –Global state –Mappings –Adapters = combinations/merge of mappings

Technische Universität München Peano 2, Jun T-Architecture: The namespace tarch Peano’s Principles –Global constants, assertions –Log statements –xml parsing utilities –Linear algebra routines –Test environment –Output routines (vtk/Paraview, TecPlot) Rationale –Direct usage (just include it) –Static linked –Own namespace (not peano) as other apps use it, too (preCICE, e.g.) #include ‘‘tarch/logging/Log.h‘‘ class peano::applications::poisson::AbstractSolver { private: static tarch::logging::Log _log; protected: [... ] void peano::applications::poisson::AbstractSolver::foo() { [... ] _log.debug( ‘‘ foo ‘‘(), ‘‘ this is just a log ‘‘ ); [... ]

Technische Universität München Peano 2, Jun Automatic testing –Testing framework is part of T-architecture –Each application defines set of tests –Tests are executed by all developers all the time Implementation –Create subclass of tarch::TestCase –Add run method and register test –Make run method (or submethods) and use validate macros –Run code with test configuration file Unit Tests void MyTestCase::run() { void testGetters(); } void MyTestCase::testGetters() { [...] validateEquals( myObject.getSomething(), 1.2, ‘‘testGetters()‘‘ ); [...] } validateEquals in line xxx in file MyTestCase.cpp failed: 0.2 instead of 1.2. Running test case collection peano.kernel.spacetreegrid.tests ok Running test case collection MyTestCase failed Runnint test case collection unit tests failed

Technische Universität München Peano 2, Jun One Config File Policy –One xml file configures application (no other arguments) –Each top level tag defines one program run –Unit Tests equal one program run Structure –Logging tags –Test tag –(Main) Application tag App-specific (sub-)tags Spacetree-/ Regulargrid subtag Geometry subtag Plotter/ output subtags –etc. Configuration Files <log-output column-separator=" " log-time-stamp="yes" log-time-stamp-human-readable="yes" log-machine-name="no" log-message-type="yes" log-trace="yes" />... <spacetree-grid number-of-vertices-on-reference-level="18 ; 18 ; 18" number-of-simulation-grid-levels="2" domain-size="1.0 ; 1.0 ; 1.0" domain-offset="0.0 ; 0.0 ; 0.0" />...

Technische Universität München Peano 2, Jun Technical principles –No difference between grid construction and other traversals –Grid creation events –Every user steers grid construction by –him-/ herself Math –Computational domain shrinks to computational grid –Each refinement at boundary makes grid grow to continuous domain –Three types of vertices: inside, outside, boundary. Special callbacks –for each vertex creation. –Two types of cells: inside, outside –Use peano::grid::GeometryHelper Grid Setup

Technische Universität München Peano 2, Jun Technical principles –No difference between grid construction and other traversals –Grid creation events –Every user steers grid construction by –him-/ herself Math –Computational domain shrinks to computational grid –Each refinement at boundary makes grid grow to continuous domain –Three types of vertices: inside, outside, boundary. Special callbacks –for each vertex creation. –Two types of cells: inside, outside –Use peano::grid::GeometryHelper Grid Setup void MyMapping::createBoundaryVertex(MyVertex& arg) { [...] // initialise values within this vertex: // set Dirichlet values etc. [...] }

Technische Universität München Peano 2, Jun Agenda Peano's Principles – k-spacetrees – Grid traversal & call-back mechanism Peano Architecture – Philosophy and terminology – T-Architecture – Unit tests – Configuration files – Grid setup PeProt: Automatic Code Generation – Model the degrees of freedom – Introducing behaviour

Technische Universität München Peano 2, Jun PeProt: Automatic Code Generation PeProt scripting –Define your data structures –Define application-specific mappings –Define mapping combinations as adapters –Stencil evaluations: Simple definition and automatic code generation for these –types of vertex-/ cell-events component: multigrid configuration-tag: poissonmultigrid repository: MultigridBatchJob namespace: peano::applications::poisson::multigrid vertex: name: Vertex dastgen-file: Vertex.def read scalar: Residual read scalar: U read stencil: Stencil read vector2PowD: TempP read vector2PowD: TempAP write scalar: Residual write stencil: Stencil write vector2PowD: TempP write vector2PowD: TempAP... event-mapping: name: SetupExperiment event-mapping: name: PlotSolution … adapter: name: SetupExperimentAndPlotStartSolution merge-with-user-defined-mapping: SetupExperiment merge-with-user-defined-mapping: PlotSolution

Technische Universität München Peano 2, Jun Model the Degrees of Freedom Application Model –DaStGen – similar to C++ –Automatically adds getter, setter, MPI, etc. –Automatically reduces memory footprint –For both vertices and cells Grid-Vertex/-Cell Superclass –Let DaStGen application models inherit –from these superclasses –Hold refinement status, parallelisation information, etc. –Hold flags for hanging nodes Integration –DaStGen performs hierarchy flattening (reduce memory footprint further) –Put generated records in a records subdirectory –Create your (vertex-) operations in user-defined classes –Instantiate grid with your vertices/cells as type argument Vertex holds properties Cell holds properties

Technische Universität München Peano 2, Jun Model the Degrees of Freedom Vertex holds properties Cell holds properties Application Model –DaStGen – similar to C++ –Automatically adds getter, setter, MPI, etc. –Automatically reduces memory footprint –For both vertices and cells Grid-Vertex/-Cell Superclass –Let DaStGen application models inherit –from these superclasses –Hold refinement status, parallelisation information, etc. –Hold flags for hanging nodes Integration –DaStGen performs hierarchy flattening (reduce memory footprint further) –Put generated records in a records subdirectory –Create your (vertex-) operations in user-defined classes –Instantiate grid with your vertices/cells as type argument #include "peano/utils/Globals.h" #include "tarch/logging/Log.h" Packed-Type: short int; class peano::applications::poisson::records::PoissonCellDoF { enum Type { UNDEF, INNER, BOUNDARY }; persistent packed Type _type; };

Technische Universität München Peano 2, Jun Introducing Behaviour Starting Point –Cells, vertices, mappings, runners etc. have been generated –Cell- and vertexwise operations are implemented –There’s a configuration class for new solver Mapping –Open generated mapping –Trigger operations within the mapping –callbacks –Simulation State: DaStGen-generated record, –holding the state information of the solver –→ relaxation parameters, number of timesteps... Integrate –Instantiate grid (from configuration, geometry...) –Trigger adapter calls within runner: One line of code! void MyMapping::enterCell( Cell& cell, Vertices* vertices ) { [...] if ( cell.isSolverCell() && vertices[0].isPersistent() ) { _solver.evaluateStencil( cell,vertices ); } [...] } void MyRunner::run(){... myAdapterRepository.switchToMySolverAdapter(); myAdapterRepository.iterate(); }

Technische Universität München Peano 2, Jun Conclusion & Features revisited Peano 2: Grid enviroment for adaptive multiscale descriptions – PDE solvers (finite elements, finite differences) – Multilevel/ Multigrid schemes – Flexible geometry discretisation Adaptive Cartesian Grids –Arbitrary adaptivity –Arbitrary dimensions (2D/3D/...) –Dynamic refinement & coarsening Memory Behaviour –Very low memory requirements –Good cache behaviour Parallelisation –Shared and/or distributed –memory parallelisation –Domain decomposition model

Technische Universität München Peano 2, Jun Current Projects Persons in charge Tobias Weinzierl Tobias Neckel Janos Benk Bernhard Gatzhammer Michael Lieb Philipp Neumann Marion Bendig Kristof Unterweger Atanas Atanasov CFD (Navier-Stokes) FSI Heat Equation Turbulent Flows Chemical Reactions Framework’s use depends on applications Applications’ feedback improves framework Lattice Boltzmann Poisson Eq. - Multigrid Sundance coupling Computational steering Shallow Water Equations

Technische Universität München Peano 2, Jun Thank you!