Increasing programmability

Similar documents
Vice Chairman of Modelica Association Director of Open Source Modelica Consortium

Integrated Modeling of CPS including Requirements: Open Source MBSE Tools Based on Modelica and UML

Research in Model-Based Product Development at PELAB in the MODPROD Center

Research in Model-Based Product Development at PELAB in the MODPROD Center

MetaModelica A Unified Equation-Based Semantical and Mathematical Modeling Language

int a; class x { public int a; class x { float b; Asda ad public int a; Asa asad Aac sdscfcc c a

Modelica Environments and OpenModelica

Integrated Model-Driven Development Environments for Equation-Based Object-Oriented Languages

1st Annual OpenModelica Workshop Feb 2, 2009

Towards Unified System Modeling with the ModelicaML UML Profile

Modelica Language Concepts. Classes and Inheritance

4th Annual OpenModelica Workshop Feb 6, 2012

High Level Mathematical Modeling and Parallel/GRID Computing with Modelica. Peter Fritzson

5th Annual OpenModelica Workshop Feb 4, 2013

Towards Run-time Debugging of Equation-based Object-oriented Languages

3rd Annual OpenModelica Workshop Feb 7, 2011

9th Annual OpenModelica Workshop Feb 6, 2017

Introduction to Object-Oriented Modeling, Simulation, Debugging and Dynamic Optimization with Modelica using OpenModelica

The Modelica Object-Oriented Equation-Based Language and Its OpenModelica Environment with MetaModeling, Interoperability, and Parallel Execution

The Language for Cyber-Physical Systems

CIM 2 Modelica Factory

Technical Overview of OpenModelica and its Development Environment

2 Copyright Open Source Modelica Consortium. September pages. Wiley IEEE Press. 4 Copyright Open Source Modelica Consortium.

Functional Mockup Interface for Tool and Model Interoperability

Software-Entwicklungswerkzeuge

Software-Entwicklungswerkzeuge. Modelica Overview. Contents. 1. Modelica Introduction. 2. Modelica Users View. 3. Modelica Libraries

Simulation and Benchmarking of Modelica Models on Multi-core Architectures with Explicit Parallel Algorithmic Language Extensions

INTRODUCTION TO OBJECT-ORIENTED MODELING AND SIMULATION WITH MODELICA USING THE OPENMODELICA ENVIRONMENT

Modeling Technical Systems [ ] Mag MA MA Schweiger Gerald TU Graz Spring 2017

To All Participants!

SkePU User Guide 1. Christoph Kessler. Linköping University. May 28th, 2015 Revised July 20, Copyright c 2015 held by the authors.

Parallel Computing Using Modelica

Technical Overview of OpenModelica and its Development Environment

Technical Overview of OpenModelica and its Development Environment

MODPROD'2014 8th International Workshop on Model-Based Product Development

Cluster-SkePU: A Multi-Backend Skeleton Programming Library for GPU Clusters

Functional Mockup Interface (FMI) A General Standard for Model Exchange and Simulator Coupling

Model-Based Dynamic Optimization with OpenModelica and CasADi

OpenModelica Environment and Modelica Overview

Technical Overview of OpenModelica and its Development Environment

EXPRESSING REQUIREMENTS IN MODELICA

Proceedings of the 4th International Modelica Conference, Hamburg, March 7-8, 2005, Gerhard Schmitz (editor)

Introduction to Object Introduction to Object--Oriented Oriented Modeling, Simulation and Control with Modelica T torial Tut Tu or o ia i l for

This is the published version of a paper presented at IEEE PES General Meeting 2013.

Seamlessly Integrating Software & Hardware Modelling for Large-Scale Systems

SkePU 2 User Guide For the preview release

Technical Overview of OpenModelica and its Development Environment

ModelicaML: Getting Started Issue April 2012

INTEROPERABILITY WITH FMI TOOLS AND SOFTWARE COMPONENTS. Johan Åkesson

Integration of OpenModelica in Ptolemy II

OMEdit. OpenModelica Connection Editor. User Manual Version April 2011

Modelica- A cyber-physical modeling language and the OpenModelica environment

Modelica. Language, Libraries, Tools, Workshop and EU-Project RealSim

Enhancing the RAMSAS method for Systems Reliability Analysis through Modelica

Oriented Modeling and Simulation with Modelica

OpenModelica Development Environment with Eclipse Integration for Browsing, Modeling, and Debugging

OMEdit OpenModelica Connection Editor

POTENTIAL AND BENEFITS OF FUNCTIONAL MOCK-UP INTERFACE - FMI FOR VIRTUAL VEHICLE INTEGRATION

Predictable Timing Analysis of x86 Multicores using High-Level Parallel Patterns

Execution of UML State Machines Using Modelica

Parallel Code Generation in MathModelica / An Object Oriented Component Based Simulation Environment

An Easy-to-use Generic Model Configurator for Models in Multiple Tool Formats

Contributions to Parallel Simulation of Equation-Based Models on Graphics Processing Units

and its Development Environment

Dynamic Load Balancing in Parallelization of Equation-based Models

Vision of Building Simulation

Dymola Dynamic Modeling Laboratory

Programming Support for Heterogeneous Parallel Systems

Simulation-based development of automotive control software with Modelica

Automatic Regression Testing of Simulation Models and Concept for Simulation of Connected FMUs in PySimulator

AUTOMATIC PARALLELIZATION OF OBJECT ORIENTED MODELS ACROSS METHOD AND SYSTEM

OpenModelica OMShell and OMNotebook Introduction and Exercises

Equation-Based Modeling with Modelica Principles and Future Challenges

Simulation-based development of automotive control software with Modelica

PERFORMANCE PORTABILITY WITH OPENACC. Jeff Larkin, NVIDIA, November 2015

Towards Unified System Modeling and Simulation with ModelicaML: Modeling of Executable Behavior Using Graphical Notations

Industrial Evaluation of an Efficient Equation Model Debugger in OpenModelica

Modeling Kernel Language (MKL)

XPDL: Extensible Platform Description Language to Support Energy Modeling and Optimization

Modeling physical properties. Controller, plant and environment model

Rotational3D Efficient modelling of 3D effects in rotational mechanics

Variable Structure Modeling for Vehicle Refrigeration Applications

The Functional Mockup Interface for Tool independent Exchange of Simulation Models

Modeling, Simulation and Analysis of Integrated Building Energy and Control Systems. Michael Wetter. October 8, 2009

Automatic Parallelization of Mathematical Models Solved with Inlined Runge-Kutta Solvers

The Research Centre on Zero Energy Neighbourhoods in Smart Cities - ZEN

Parallel Systems. Project topics

Proceedings of the 4th International Modelica Conference, Hamburg, March 7-8, 2005, Gerhard Schmitz (editor)

An innovative compilation tool-chain for embedded multi-core architectures M. Torquati, Computer Science Departmente, Univ.

Modelica3D. Platform Independent Simulation Visualization. Christoph Höger. Technische Universität Berlin Fraunhofer FIRST

HPC with GPU and its applications from Inspur. Haibo Xie, Ph.D

ULISSE. Carlo Albanese Telespazio. ASI Workshop on Space Foundations Rome, 29 May 2012

An Overview of the SysML-Modelica Transformation Specification

An Extension of the StarSs Programming Model for Platforms with Multiple GPUs

Real-time transient stability simulation tool

Multigrid algorithms on multi-gpu architectures

Design of embedded mixed-criticality CONTRol systems under consideration of EXtra-functional properties

MAGMA. Matrix Algebra on GPU and Multicore Architectures

Institutionen för datavetenskap

MathWorks Technology Session at GE Physical System Modeling with Simulink / Simscape

Transcription:

Increasing programmability with domain- specific languages Kris6an Sandahl, Peter Fritzson, Christoph Kessler PELAB Department of Computer and Informa6on Science Linköping University

PELAB at a Glance Programming environments laboratory, founded in 1981 Staff: 5 professors, 4 assistant professors, 11 phd students, 4 engineers Current topics: Compiler technology SoQware composi6on Parallel compu6ng Design and implementa6on of programming and modeling languages and systems Equa6on- based object- oriented modeling and simula6on languages Large- scale soqware engineering Requirements engineering SoQware tes6ng and debugging

Problem Produc6vity and Quality of human- made soqware

Means Raise the abstrac6on level Model- based SoQware Engineering Domain- specific Languages Skeletons and pawerns SoQware models System models Parallel programming and mul6core processing MODELICA SySML Use SkePU skeleton programming Sequen6al interface Simula6on Visualiza6on Valida6on Heterogeneous systems Pla[orm agnos6c High- level constructs

Modelica A Cyber-Physical Modeling Language for Systems Engineering and the OpenModelica Environment September 25, 2014 STEW Workshop Peter Fritzson Professor at Linköping University, Sweden Vice Chairman of Modelica Association Director of Open Source Modelica Consortium Senior Member, IEEE peter.fritzson@liu.se

What is Modelica? A language for modeling of complex cyber-physical systems Robotics Control Automotive Aircraft Satellites Power plants Systems biology 6

What is Special about Modelica? Multi-Domain Modeling Cyber-Physical Modeling Physical 3 domains - electric - mechanics - control Cyber 7

What is Special about Modelica? Multi-Domain Modeling qddref qdref 1 S qref 1 S k2 i k1 i r3control Hierarchical system modeling r3motor r3drive1 1 cut joint qd tn axis6 axis5 Visual Acausal Hierarchical Component Modeling q: angle qdref Kd 0.03 S rel qref psum - Kv 0.3 +1 +1 sum wsum - rate2 b(s) a(s) rate3 340.8 S iref Jmotor=J spring=c fric=rv0 gear=i joint=0 S axis4 axis3 rate1 tacho2 tacho1 b(s) a(s) b(s) a(s) PT1 g5 axis2 q Srel = n*transpose(n)+(identity(3)- Rd2=100 n*transpose(n))*cos(q)- skew(n)*sin(q); Ri=10 - - - + + diff + pow er OpI Vs Rd3=100 hall2 qd Rd1=100 wrela = n*qd; zrela = n*qdd; Sb = Sa*transpose(Srel); r0b = r0a; Rd4=100 vb = Srel*va; wb = Srel*(wa + wrela); ab = Srel*aa; g1 zb = Srel*(za + zrela + cross(wa, wrela)); g3 Rp2=50 C=0.004*D/w m Rp1=200 hall1 Ra=250 La=(250/(2*D*w m)) emf w r axis1 y x inertial g2 qd g4 q 8 Courtesy of Martin Otter

Graphical and Textual View A DC motor can be thought of as an electrical circuit which also contains an electromechanical component model DCMotor Resistor R(R=100); Inductor L(L=100); VsourceDC DC(f=10); Ground G; ElectroMechanicalElement EM(k=10,J=10, b=2); Inertia load; equation R connect(dc.p,r.n); connect(r.p,l.n); DC connect(l.p, EM.n); connect(em.p, DC.n); connect(dc.n,g.p); connect(em.flange,load.flange); G end DCMotor L EM load 9

Application of Modelica in Robotics Models Real-time Training Simulator for Flight, Driving Using Modelica models generating real-time code Different simulation environments (e.g. Flight, Car Driving, Helicopter) Developed at DLR Munich, Germany Dymola Modelica tool Courtesy of Martin Otter, DLR, Oberphaffenhofen, Germany 10

Modelica Standard Library Open Source, Developed by Modelica Association The Modelica Standard Library contains components from various application areas, including the following sublibraries: Blocks Library for basic input/output control blocks Constants Mathematical constants and constants of nature Electrical Library for electrical models Icons Icon definitions Fluid 1-dim Flow in networks of vessels, pipes, fluid machines, valves, etc. Math Mathematical functions Magnetic Magnetic.Fluxtubes for magnetic applications Mechanics Library for mechanical systems Media Media models for liquids and gases SIunits Type definitions based on SI units according to ISO 31-1992 Stategraph Hierarchical state machines (analogous to Statecharts) Thermal Components for thermal systems Utilities Utility functions especially for scripting 11

The OpenModelica Open Source Environment www.openmodelica.org Advanced Interactive Modelica compiler (OMC) Supports most of the Modelica Language Modelica and Python scripting Basic environment for creating models OMShell an interactive command handler OMNotebook a literate programming notebook MDT an advanced textual environment in Eclipse OMEdit graphic Editor OMDebugger for equations OMOptim optimization tool OM Dynamic optimizer collocation ModelicaML UML Profile MetaModelica extension ParModelica extension 12 12

OSMC International Consortium for Open Source Model-based Development Tools, 46 members Mar 2014 Founded Dec 4, 2007 Open-source community services Website and Support Forum Version-controlled source base Bug database Development courses www.openmodelica.org Code Statistics Industrial members Bosch Rexroth AG, Germany Siemens PLM, California, USA Siemens Turbo, Sweden CDAC Centre, Kerala, India Creative Connections, Prague DHI, Aarhus, Denmark EDF, Paris, France Equa Simulation AB, Sweden Fraunhofer IWES, Bremerhaven Frontway AB, Sweden IFP, Paris, France University members Austrian Inst. of Tech, Austria Linköping University, Sweden UC Berkeley, USA TU Berlin, Insti UEBB, Germany FH Bielefeld, Bielefeld, Germany TU Braunschweig, Germany Univ Calabria, Italy Danish Technical Univ, Denmark TU Dortmund, Germany TU Dresden, Germany Université Laval, Canada Georgia Inst. Technology, USA GTI, USA ISID Dentsu, Tokyo, Japan ITI, Dresden, Germany Maplesoft, Canada Ricardo Inc., USA STEAG, Dehli, India TLK Thermo, Germany Sozhou Tongyuan, China VTI, Linköping, Sweden VTT, Finland Wolfram MathCore, Sweden Ghent University, Belgium Halmstad University, Sweden Heidelberg University, Germany TU Hamburg/Harburg Germany KTH, Stockholm, Sweden Univ of Maryland, Syst Eng USA Univ of Maryland, CEEE, USA Politecnico di Milano, Italy Ecoles des Mines, CEP, France Mälardalen University, Sweden Univ Pisa, Italy Telemark Univ College, Norway 13

14 OpenModelica MDT Eclipse Plug-in with OpenModelica Algorithmic Code Debugger

General Tool Interoperability & Model Exchange Functional Mock-up Interface (FMI) The FMI development a result of the MODELISAR 29-partner project FMI development initiated by Daimler Improved Software/Model/Hardware-in-the-Loop Simulation, of physical models and of AUTOSAR controller models from different vendors for automotive applications with different levels of detail. Open Standard, standardized by Modelica Association 14 automotive use cases for evaluation > 40 tool vendors are supporting it etc. Engine with ECU Gearbox with ECU Thermal systems Automated cargo door Chassis components, roadway, ECU (e.g. ESP) functional mockup interface for model exchange and tool coupling courtesy Daimler 15

Simulation and Requirements Checking Tank system example Req. 001 is instantiated 2 times (there are 2 tanks in the system) tank-height is 0.6m Req. 001 for the tank2 is violated Req. 001 for the tank1 is not violated 16

ParModelica Modelica Parallel Algorithmic Programming Execution on GPUs and CPUs via portable OPENCL code generation Matrix Multiplication application Gained speedup Intel Xeon E5520 CPU (16 cores) 26 NVIDIA Fermi-Tesla M2050 GPU (448 cores) 115 Speedup comparison to sequential algorithm on Intel Xeon E5520 CPU Speedup CPU E5520 GPU M2050 114.67 35.95 24.76 26.34 13.41 4.36 0.61 4.61 64 128 256 512 Parameter M (Matrix sizes MxM) Simulation Time (second) 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 32 64 128 256 512 CPU E5520 (Serial) 0.093 0.741 5.875 58.426 465.234 CPU E5520 (Parallel) 0.137 0.17 0.438 2.36 17.66 GPU M2050 (Parallel) 1.215 1.217 1.274 1.625 4.057 17

Get More Information, Download Software Peter Fritzson Principles of Object Oriented Modeling and Simulation with Modelica 3.3 A Cyber-Physical Approach Wiley-IEEE Press, 2014 1250 pages OpenModelica www.openmodelica.org Modelica Association www.modelica.org 18

High-Level Programming The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again. for Heterogeneous Systems using Skeletons*" Christoph Kessler Linköping University Sweden *This research is funded by EU FP7 projects PEPPHER and EXCESS, and by SeRC" EXCESS

The Computer Engineer s Solution Today: Heterogeneous Multicore" J More energy-efficient than general-purpose sequential resp. general-purpose multicore CPU J Hardware-tailored parallel programming models J Detailed resource control General- purpose" CPU" Offload certain computation Data transfer Device memory Main Memory Programmable Hardware Accelerator " 20" "

The Application Programmer s Nightmare: Heterogeneous Multicore" L Distributed Memory or Non-coherent Shared Memory L Different Programming Models L Low Abstraction Level L Require Architecture- specific Optimization General- purpose" CPU" Offload certain computation Data transfer Device memory Main Memory Programmable Hardware Accelerator " 21" "

Common: GPU-Based Systems" L Distributed Memory L Different Programming Models L Low Abstraction Level L Require Architecture- specific Optimization CPU" Offload heavy computation Data transfer Device memory Main Memory GPU " 22" "

Common: GPU-Based Systems" L Distributed Memory L Different Programming Models L Low Abstraction Level L Require Architecture- specific Optimization CPU" Offload heavy computation Data transfer Device memory GPU " Device memory Main Memory GPU " 23" "

Programming of GPU-based Systems with OpenCL (?) - Code portability J - Programmability L (low level) - Performance portability L (requires reoptimization) CPU" Offload heavy computation Data transfer Device memory Main Memory GPU " 24" "

Skeleton Programming" A skeleton is a pre-defined generic software component that Models a common computation / dependence pattern à well-defined semantics; metadata implicit Can be customized with sequential user code" Provides a sequential interface Encapsulates all platform-specific implementation details (parallelism, heterogeneity, memory management, ) 25" "

SkePU www.ida.liu.se/~chrke/skepu C++ template library targeting GPU-based systems 6 dataparallel skeletons Map, Reduce, Scan, MapReduce, MapArray, MapOverlap (stencil) 1 task-parallel skeleton: farm STL-based containers wrapping operand data Smart containers Vector< >, Matrix< > optimizing data transfers and memory management at runtime Generation of platform-specific variants for user functions Multiple back-ends: C, OpenMP, OpenCL, CUDA, StarPU, (MPI) Hybrid CPU-GPU execution (with StarPU backend) Multi-GPU support Low overhead Auto-tunable [Dastgeer et al. IWMSE 11, MULTIPROG 12, APPT 13; PhD 14] Open-source 26" "

Summary" Domain-specific languages High level of abstraction Automatic code generation Model-based development of Cyber-Physical Systems OpenModelica open-source environment Skeleton programming Parallelism, heterogeneity, communication managed internally Performance, portability and automatic optimizations for free! 27" "