Introspection Via Self Debugging

Total Page:16

File Type:pdf, Size:1020Kb

Introspection Via Self Debugging Introspection via Self Debugging Russell Harmon [email protected] Rochester Institute of Technology Computer Science December 12, 2013 1 Introduction The omnipresent support forintrospection inmodernprogramming languages indicates the usefulness ofthe tool. [4, 5, 19, 21] Unfortunately, C, which is one ofthe most pervasiveprogramming languages and the foundation of nearly every modern operating system, does not support introspection. Byleveraging an existing debugger, an API entitled Ruminatebrings introspection to the programming language C. Debuggers have long had access to the type information which is needed for introspection. On most UNIX platforms,this is accomplished bythe debuggerreading any debugging symbolswhich may be presentin the target binary, and inspecting the stateofthe target program.These debugging symbolsarenot present by default and the compiler must be instructed to add the symbolsat compile time.These techniques are leveraged to gain the information which isneededtocreate an introspection API and building on that, an API which can convert arbitrary types to and from JSON. 2Motivation One ofthe motivating factors for anylanguage introducing introspection as a feature is the following use case: You are tasked with changing the save game format of a popular1980sstyle terminal based game from a binary format composed of writing the structswhich compose the game state to disk toamore flexible JSON format. Afterinvestigation,you discoverthatinordertodothis, you can use the Jansson [17] C library toproduce JSON.Inordertodoso,you invoke variants of the json_object_set function as given by the following prototype: int json_object_set( json_t *object, const char *key, json_t *value ); You observe that json_object_set takes as parameters the name and value ofthe field tobe written necessitating the writing of aseparate json_object_set call for every fieldof every aggregate type. After considering the literally thousands offields across the nearly three hundred structs in the game you give up in frustration. If aprogrammer were able to introspecttypes inC,they couldwrite a generalized JSON conversion function which coulddetermine the name of every aggregate type and aggregatemember procedurally thereby 1 significantly shortening the amount of code needed. A programmer couldalso use an introspective library for creation of platform independent binary structure representations for use innetwork communication. Clearly, it isasignificant convenience todevelopers to be able towritecodewhich is able to introspect upon data in a meta-programming style. 3 Introspection in Current Programming Languages Introspection is found in many ofthe programming languages commonly used todayincluding Java [19], Ruby [4], Python [21], Perl [5] and a limited formofintrospection inC++ [29]. The various approaches to introspection differin implementation details; some receiving introspection as a direct consequence ofthe way theyimplement objectswhile some provide it as part ofthe standard library. Despite this,they all provide approximately the same set offeatures.Itisbythese features thatintrospection can be defined,ratherthan the details of how the features are implemented. Introspection implementations generally provide several differentforms ofintrospection. A common form ofintrospection provided is type introspection. Specifically, aprogram leveraging type introspection is able to inspectthe types ofidentifiersorvalues used in the program. Anotherformofintrospection is function introspection.This formofintrospection allows programs to retrieve information aboutfunctions which isnot part ofthe type system, such as the function’s name or argument’s names. Finally, a third formof introspection is stack introspection.Thisallows a program to retrievealist of stack frames at agiven point in a program’s execution, commonly referred to as a stacktrace or backtrace. Existing attempts to add introspection toCor C++ frequently requireaseparatedescription ofthe object tobeimplemented which is generated using a separateparser[23], a complementary metadataobject [2], or requirespecificcodetobewritten that describes the type. All ofthese introspection implementations have the limitation that objectswhich come from externallibraries cannot be introspected. Ruminate has neither this library boundary limitation norrequires external compile-time toolsor hand written object descriptions inorderto operate.Instead, Ruminate requires only thatthe library or executable to introspect contain debugging symbols. 4 Debugging in C Therealready exist anumber oftools forinteractive debugging of Cprograms. Some ofthe morewell known ones include GDB [9], WinDBG, Visual Studio’s debugger and LLDB [25]. Traditionally, these debuggers havebeenusedinteractively via the command line wheremore recently debuggers such as the one embedded 2 within Visual Studio integrate into an IDE. Anunderstanding of debugging in general, and about LLDBspecifically arecrucialto the understanding of this document, so some time will be spent explaining debugging. Conceptually, a debuggeris composed oftwo major components, asymbol parser and a process controller. Among othertypes of symbols inabinary, Linux usually uses DWARF [6] debugging symbols.These debugging symbolsare intended for a debuggertoparse and informs the debugger about some information which isnot availableotherwise from inspection ofthe compiled binary. This information includes the source file name(s), line numberto compiled instruction mappings and type information.Interactive debugging using a debugger is possible without debugging symbols, but difficult. The other major piece of a debugger is the ability to control another process.This isnecessary inorderforthe debuggerto inspect or modify a debugee’s runtime state, set break or watchpoints and intercept signals.Inorderto accomplish this, specific support must existin the kernel which is hosting the process to be controlled. Across the various modern platforms,thereexistsseveral differentimplementations enabling one process to control another. On Linux, the API for process control is ptrace(2) [20]. An important aspect ofthe type information which isavailable to a debuggeris thatthis information isalmost entirely static. Forinstance, during an interactive debugging session when printing a variable the debugger knows only the type ofthe variable being displayed,ratherthan the type ofthe data itself. This is instark contrast withotherintrospective languages where the type information iscarried with the data and can be recovered without any additional context. An example of the result of this under LLDBisshownin Fig. 1. Notice that even though the value of baz is the string "Hello World!", because the type of baz is void *, LLDB is unable to deduce the type. 4.1 LLDB LLDB [25] is a debugger built on the LLVM [27] framework. Designed to be used as a library, it vends a public C++ API which is promised to be relatively stable, and has bindings to Python in which the LLDB authors have written its unit test suite [24]. Figure2showsasimple debugging session using LLDB.In it, a test program is launched and the value of astack-localvariable isprinted.Take note that LLDB isaware thatthe type of foo.bar is char *.In factregardless ofthe language most debuggers make available to their users a non-strict subset ofthe type information which is available to the programmer writing the original source file. Under LLDB’spublic API, a type is represented by an SBType [18]. Inorderto get an instance of SBType,you can eitherretrieve the type by name, orretrieve the type of a variablebythatvariable’s name 3 Process 12066 stopped * thread #1: tid = 0x1c03, 0x0000000100000f64 a.out‘main + 20 at a.c:3 frame #0: 0x0000000100000f64 a.out‘main + 20 at a.c:3 1 int main() { 2 void *baz = "Hello World!"; -> 3 } (lldb) print baz (void *) $0 = 0x0000000100000f66 Figure 1: Static Type Information in Debuggers Current executable set to ’./a.out’ (x86_64). (lldb) breakpoint set -n main Breakpoint created: 1: name = ’main’, locations = 1 (lldb) run Process 10103 launched: ’./a.out’ (x86_64) Process 10103 stopped * thread #1: tid = 0x1c03, 0x0000000100000f60 a.out‘main + 16 at a.c:6 frame #0: 0x0000000100000f60 a.out‘main + 16 at a.c:6 3 }; 4 int main() { 5 struct foo foo; -> 6 foo.bar = "Hello World!"; 7} (lldb) next Process 10103 stopped * thread #1: tid = 0x1c03, 0x0000000100000f64 a.out‘main + 20 at a.c:7 frame #0: 0x0000000100000f64 a.out‘main + 20 at a.c:7 4 int main() { 5 struct foo foo; 6 foo.bar = "Hello World!"; -> 7 } (lldb) print foo.bar (char *) $0 = 0x0000000100000f66 "Hello World!" Figure 2: Interactive Debugging with LLDB 4 with the debugee stopped at abreakpoint. Once thatis accomplished, an SBType can give you much ofthe static type information about that variable which exists in the target’s debugging symbols. When an operation isperformed on an SBType, LLDB lazily retrieves the type information needed to service that operation. Building on clang [3], LLDB uses the debugging symbols to generate a partial clang AST. This AST is then retained for future inspection of that type. 5RelatedWork A System for Runtime Type Introspection inC++ [2] discusses an approach to introspection for C++ whereby metadata objectsarecreated using macros which areexpected tobecalled atthe definition ofthe object which is to be introspected. The Seal C++ Reflection System [23] discusses an introspection system for C++ which uses a metadata generation tool to create descriptor files which contain the information needed for introspection.
Recommended publications
  • Developer's Guide Sergey A
    Complex Event Processing with Triceps CEP v1.0 Developer's Guide Sergey A. Babkin Complex Event Processing with Triceps CEP v1.0 : Developer's Guide Sergey A. Babkin Copyright © 2011, 2012 Sergey A. Babkin All rights reserved. This manual is a part of the Triceps project. It is covered by the same Triceps version of the LGPL v3 license as Triceps itself. The author can be contacted by e-mail at <[email protected]> or <[email protected]>. Many of the designations used by the manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this manual, and the author was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this manual, the author assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. Table of Contents 1. The field of CEP .................................................................................................................................. 1 1.1. What is the CEP? ....................................................................................................................... 1 1.2. The uses of CEP ........................................................................................................................ 2 1.3. Surveying the CEP langscape ....................................................................................................... 2 1.4. We're not in 1950s any more,
    [Show full text]
  • More Efficient Serialization and RMI for Java
    To appear in: Concurrency: Practice & Experience, Vol. 11, 1999. More Ecient Serialization and RMI for Java Michael Philippsen, Bernhard Haumacher, and Christian Nester Computer Science Department, University of Karlsruhe Am Fasanengarten 5, 76128 Karlsruhe, Germany [phlippjhaumajnester]@ira.u ka.de http://wwwipd.ira.uka.de/JavaPa rty/ Abstract. In current Java implementations, Remote Metho d Invo ca- tion RMI is to o slow, esp ecially for high p erformance computing. RMI is designed for wide-area and high-latency networks, it is based on a slow ob ject serialization, and it do es not supp ort high-p erformance commu- nication networks. The pap er demonstrates that a much faster drop-in RMI and an ecient drop-in serialization can b e designed and implemented completely in Java without any native co de. Moreover, the re-designed RMI supp orts non- TCP/IP communication networks, even with heterogeneous transp ort proto cols. We demonstrate that for high p erformance computing some of the ocial serialization's generality can and should b e traded for sp eed. Asaby-pro duct, a b enchmark collection for RMI is presented. On PCs connected through Ethernet, the b etter serialization and the improved RMI save a median of 45 maximum of 71 of the runtime for some set of arguments. On our Myrinet-based ParaStation network a cluster of DEC Alphas wesave a median of 85 maximum of 96, compared to standard RMI, standard serialization, and Fast Ethernet; a remote metho d invo cation runs as fast as 80 s round trip time, compared to ab out 1.5 ms.
    [Show full text]
  • Course Outlines
    COURSE NAME PYTHON PROGRAMMING OVERVIEW OBJECTIVES Python is a general-purpose, versatile, and popular How Python works and its place in the world of programming language. It is a great first language programming languages; to work with and because it is concise and easy to read, and it is also manipulate strings; to perform math operations; to a good language to have in any programmer’s stack work with Python sequences; to collect user input as it can be used for everything from web and output results; flow control processing; to write development to software development and scientific to, and read from, files; to write functions; to handle applications. exception; and work with dates and times. WHO SHOULD ATTEND PRE-REQUISITES Students new to the language. Some experience with other programming languages DELIVERY METHOD DURATION Instructor-led virtual course 5 days (40 hours) COURSE OUTLINE PYTHON INSTALLATION LOOPS Python Distributions (ActivePython, Anaconda, For(each) loop MiniConda) Absence of traditional for (i=0, i<n, i++) loop Additional Modules (Pip, conda, easy_install) Basic Examples with foreach loop PYTHON INTRODUCTION & BASICS Emulating Traditional for loops using range(n) The Python interpreter While Loops Working with command-line/IDE FUNCTIONS Python Data Types Def Keyword Built in operators, functions and methods Functions without args Data and type introspection basics: type (), dir() Functions with fixed num of args Syntax (Blocks and indentation) Functions with variable number of args and default Concepts (Scope,
    [Show full text]
  • Reflecting on an Existing Programming Language
    Vol. 6, No. 9, Special Issue: TOOLS EUROPE 2007, October 2007 Reflecting on an Existing Programming Language Andreas Leitner, Dept. of Computer Science, ETH Zurich, Switzerland Patrick Eugster, Dept. of Computer Science, Purdue University, USA Manuel Oriol, Dept. of Computer Science, ETH Zurich, Switzerland Ilinca Ciupa, Dept. of Computer Science, ETH Zurich, Switzerland Reflection has proven to be a valuable asset for programming languages, es- pecially object-oriented ones, by promoting adaptability and extensibility of pro- grams. With more and more applications exceeding the boundary of a single address space, reflection comes in very handy for instance for performing con- formance tests dynamically. The precise incentives and thus mechanisms for reflection vary strongly between its incarnations, depending on the semantics of the considered programming lan- guage, the architecture of its runtime environment, safety and security concerns, etc. Another strongly influential factor is legacy, i.e., the point in time at which the corresponding reflection mechanisms are added to the language. This parameter tends to dictate the feasible breadth of the features offered by an implementation of reflection. This paper describes a pragmatic approach to reflection, consisting in adding introspection to an existing object-oriented programming language a posteriori, i.e., without extending the programming language, compiler, or runtime environ- ment in any specific manner. The approach consists in a pre-compiler generating specific code for types which are to be made introspectable, and an API through which this code is accessed. We present two variants of our approach, namely a homogeneous approach (for type systems with a universal root type) and a heterogeneous approach (without universal root type), and the corresponding generators.
    [Show full text]
  • An Organized Repository of Ethereum Smart Contracts' Source Codes and Metrics
    Article An Organized Repository of Ethereum Smart Contracts’ Source Codes and Metrics Giuseppe Antonio Pierro 1,* , Roberto Tonelli 2,* and Michele Marchesi 2 1 Inria Lille-Nord Europe Centre, 59650 Villeneuve d’Ascq, France 2 Department of Mathematics and Computer Science, University of Cagliari, 09124 Cagliari, Italy; [email protected] * Correspondence: [email protected] (G.A.P.); [email protected] (R.T.) Received: 31 October 2020; Accepted: 11 November 2020; Published: 15 November 2020 Abstract: Many empirical software engineering studies show that there is a need for repositories where source codes are acquired, filtered and classified. During the last few years, Ethereum block explorer services have emerged as a popular project to explore and search for Ethereum blockchain data such as transactions, addresses, tokens, smart contracts’ source codes, prices and other activities taking place on the Ethereum blockchain. Despite the availability of this kind of service, retrieving specific information useful to empirical software engineering studies, such as the study of smart contracts’ software metrics, might require many subtasks, such as searching for specific transactions in a block, parsing files in HTML format, and filtering the smart contracts to remove duplicated code or unused smart contracts. In this paper, we afford this problem by creating Smart Corpus, a corpus of smart contracts in an organized, reasoned and up-to-date repository where Solidity source code and other metadata about Ethereum smart contracts can easily and systematically be retrieved. We present Smart Corpus’s design and its initial implementation, and we show how the data set of smart contracts’ source codes in a variety of programming languages can be queried and processed to get useful information on smart contracts and their software metrics.
    [Show full text]
  • Flexible Composition for C++11
    Maximilien de Bayser Flexible Composition for C++11 Disserta¸c~aode Mestrado Dissertation presented to the Programa de P´os-Gradua¸c~ao em Inform´atica of the Departamento de Inform´atica, PUC-Rio as partial fulfillment of the requirements for the degree of Mestre em Inform´atica. Advisor: Prof. Renato Fontoura de Gusm~ao Cerqueira Rio de Janeiro April 2013 Maximilien de Bayser Flexible Composition for C++11 Dissertation presented to the Programa de P´os-Gradua¸c~ao em Inform´atica of the Departamento de Inform´atica, PUC-Rio as partial fulfillment of the requirements for the degree of Mestre em Inform´atica. Approved by the following commission: Prof. Renato Fontoura de Gusm~aoCerqueira Advisor Pontif´ıcia Universidade Cat´olica do Rio de Janeiro Prof. Alessandro Garcia Department of Informatics { PUC-Rio Prof. Waldemar Celes Department of Informatics { PUC-Rio Prof. Jos´eEugenio Leal Coordinator of the Centro T´ecnico Cient´ıfico Pontif´ıcia Universidade Cat´olica do Rio de Janeiro Rio de Janeiro | April 4th, 2013 All rights reserved. It is forbidden partial or complete reproduction without previous authorization of the university, the author and the advisor. Maximilien de Bayser Maximilien de Bayser graduated from PUC-Rio in Computer Engineering. He is also working at the Research Center for Inspection Technology where he works on software for non- destructive testing of oil pipelines and flexible risers for PE- TROBRAS. Bibliographic data de Bayser, Maximilien Flexible Composition for C++11 / Maximilien de Bayser; advisor: Renato Fontoura de Gusm~ao Cerqueira . | 2013. 107 f. : il. ; 30 cm 1. Disserta¸c~ao(Mestrado em Inform´atica) - Pontif´ıcia Universidade Cat´olica do Rio de Janeiro, Rio de Janeiro, 2013.
    [Show full text]
  • Objective-C Fundamentals
    Christopher K. Fairbairn Johannes Fahrenkrug Collin Ruffenach MANNING Objective-C Fundamentals Download from Wow! eBook <www.wowebook.com> Download from Wow! eBook <www.wowebook.com> Objective-C Fundamentals CHRISTOPHER K. FAIRBAIRN JOHANNES FAHRENKRUG COLLIN RUFFENACH MANNING SHELTER ISLAND Download from Wow! eBook <www.wowebook.com> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 261 Shelter Island, NY 11964 Email: [email protected] ©2012 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled
    [Show full text]
  • Objective-C Language and Gnustep Base Library Programming Manual
    Objective-C Language and GNUstep Base Library Programming Manual Francis Botto (Brainstorm) Richard Frith-Macdonald (Brainstorm) Nicola Pero (Brainstorm) Adrian Robert Copyright c 2001-2004 Free Software Foundation Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another lan- guage, under the above conditions for modified versions. i Table of Contents 1 Introduction::::::::::::::::::::::::::::::::::::: 3 1.1 What is Object-Oriented Programming? :::::::::::::::::::::::: 3 1.1.1 Some Basic OO Terminology :::::::::::::::::::::::::::::: 3 1.2 What is Objective-C? :::::::::::::::::::::::::::::::::::::::::: 5 1.3 History :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 5 1.4 What is GNUstep? ::::::::::::::::::::::::::::::::::::::::::::: 6 1.4.1 GNUstep Base Library :::::::::::::::::::::::::::::::::::: 6 1.4.2 GNUstep Make Utility :::::::::::::::::::::::::::::::::::: 7 1.4.3 A Word on the Graphical Environment :::::::::::::::::::: 7 1.4.4 The GNUstep Directory Layout ::::::::::::::::::::::::::: 7 1.5 Building Your First Objective-C Program :::::::::::::::::::::: 8 2 The Objective-C Language :::::::::::::::::::
    [Show full text]
  • A Sequel to the Static C++ Object-Oriented Programming Paradigm (SCOOP 2)
    Semantics-Driven Genericity: A Sequel to the Static C++ Object-Oriented Programming Paradigm (SCOOP 2) Thierry G´eraud,Roland Levillain EPITA Research and Development Laboratory (LRDE) 14-16, rue Voltaire, FR-94276 Le Kremlin-Bic^etreCedex, France [email protected], [email protected] Web Site: http://www.lrde.epita.fr Abstract. Classical (unbounded) genericity in C++03 defines the inter- actions between generic data types and algorithms in terms of concepts. Concepts define the requirements over a type (or a parameter) by ex- pressing constraints on its methods and dependent types (typedefs). The upcoming C++0x standard will promote concepts from abstract en- tities (not directly enforced by the tools) to language constructs, enabling compilers and tools to perform additional checks on generic constructs as well as enabling new features (e.g., concept-based overloading). Most modern languages support this notion of signature on generic types. How- ever, generic types built on other types and relying on concepts|to both ensure type conformance and drive code specialization|restrain the in- terface and the implementation of the newly created type: specific meth- ods and associated types not mentioned in the concept will not be part of the new type. The paradigm of concept-based genericity lacks the re- quired semantics to transform types while retaining or adapting their intrinsic capabilities. We present a new form of semantically-enriched genericity allowing static, generic type transformations through a sim- ple form of type introspection based on type metadata called properties. This approach relies on a new Static C++ Object-Oriented Programming (Scoop) paradigm, and is adapted to the creation of generic and efficient libraries, especially in the field of scientific computing.
    [Show full text]
  • Efficient Data Communication Between a Webclient and a Cloud Environment
    Kit Gustavsson & Erik Stenlund Efficient data communication between a webclient and a cloud environment a cloud and webclient a between communication data Efficient Master’s Thesis Efficient data communication between a webclient and a cloud environment Kit Gustavsson Erik Stenlund Series of Master’s theses Department of Electrical and Information Technology LU/LTH-EIT 2016-528 http://www.eit.lth.se Department of Electrical and Information Technology, Faculty of Engineering, LTH, Lund University, 2016. Efficient data communication between a webclient and a cloud environment Kit Gustavsson [email protected] Erik Stenlund [email protected] Axis Communications Emdalavägen 14 Advisor: Maria Kihl June 23, 2016 Printed in Sweden E-huset, Lund, 2016 Abstract Modern single page web applications that continuously transfer a lot of data be- tween the clients and the server require new techniques for communicating this data. The REST architecture has for a long time been the most common solu- tion when developing web APIs but the technique GraphQL has in recent time become an interesting alternative to REST. This thesis had two major purposes, the first was to investigate and point out the difference between using REST and a GraphQL solution when developing a web API. The second was to, based on the results of the investigation, create a decision model that may be used as support when deciding on what type of tech- nique to use and the effect of the decision when developing a web application. Prototypes of each API were implemented and used to conduct measurements of each technique’s performance. Additional infrastructure such as web servers and load generators were also developed for the measurements.
    [Show full text]
  • The Objective-C Programming Language
    Inside Mac OS X The Objective-C Programming Language February 2003 Apple Computer, Inc. Even though Apple has reviewed this © 2002 Apple Computer, Inc. manual, APPLE MAKES NO All rights reserved. WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH No part of this publication may be RESPECT TO THIS MANUAL, ITS reproduced, stored in a retrieval QUALITY, ACCURACY, system, or transmitted, in any form or MERCHANTABILITY, OR FITNESS by any means, mechanical, electronic, FOR A PARTICULAR PURPOSE. AS A photocopying, recording, or RESULT, THIS MANUAL IS SOLD “AS otherwise, without prior written IS,” AND YOU, THE PURCHASER, ARE permission of Apple Computer, Inc., ASSUMING THE ENTIRE RISK AS TO with the following exceptions: Any ITS QUALITY AND ACCURACY. person is hereby authorized to store documentation on a single computer IN NO EVENT WILL APPLE BE LIABLE for personal use only and to print FOR DIRECT, INDIRECT, SPECIAL, copies of documentation for personal INCIDENTAL, OR CONSEQUENTIAL use provided that the documentation DAMAGES RESULTING FROM ANY contains Apple’s copyright notice. DEFECT OR INACCURACY IN THIS The Apple logo is a trademark of MANUAL, even if advised of the Apple Computer, Inc. possibility of such damages. Use of the “keyboard” Apple logo THE WARRANTY AND REMEDIES SET (Option-Shift-K) for commercial FORTH ABOVE ARE EXCLUSIVE AND purposes without the prior written IN LIEU OF ALL OTHERS, ORAL OR consent of Apple may constitute WRITTEN, EXPRESS OR IMPLIED. No trademark infringement and unfair Apple dealer, agent, or employee is competition in violation of federal authorized to make any modification, and state laws.
    [Show full text]
  • Arxiv:2003.07798V3 [Cs.MS] 1 Sep 2021
    PRESSIO: ENABLING PROJECTION-BASED MODEL REDUCTION FOR LARGE-SCALE NONLINEAR DYNAMICAL SYSTEMS ∗ FRANCESCO RIZZI† , PATRICK J. BLONIGAN‡ , ERIC J. PARISH‡ , AND KEVIN T. CARLBERG‡§ Abstract. This work introduces Pressio, an open-source project aimed at enabling leading- edge projection-based reduced order models (ROMs) for large-scale nonlinear dynamical systems in science and engineering. Pressio provides model-reduction methods that can reduce both the num- ber of spatial and temporal degrees of freedom for any dynamical system expressible as a system of parameterized ordinary differential equations (ODEs). We leverage this simple, expressive mathe- matical framework as a pivotal design choice to enable a minimal application programming interface (API) that is natural to dynamical systems. The core component of Pressio is a C++11 header-only library that leverages generic programming to support applications with arbitrary data types and arbitrarily complex programming models. This is complemented with Python bindings to expose these C++ functionalities to Python users with negligible overhead and no user-required binding code. We discuss the distinguishing characteristics of Pressio relative to existing model-reduction libraries, outline its key design features, describe how the user interacts with it, and present two test cases—including one with over 20 million degrees of freedom—that highlight the performance results of Pressio and illustrate the breath of problems that can be addressed with it. Key words. projection-based model reduction, Galerkin, LSPG, POD, SVD, sample mesh, hyper-reduction, scientific computing, object-oriented programming, generic programming, policy- based design, design by introspection, template metaprogramming, HPC, Kokkos, Trilinos, Python. AMS subject classifications. 65L05, 65L06, 65M12, 68U20, 68N15, 68W10, 68W15, 68N01, 76K05 1.
    [Show full text]