In conclusion our tool: can be used with any operator overloading AD package replaces the manual process, which is slow and overestimates the number active.

Slides:



Advertisements
Similar presentations
The Problem Decomposition of programs in terms of classes and in terms of crosscutting concerns are both useful, but languages based on source files allow.
Advertisements

C Language.
Automatic Differentiation Tutorial
Jaewook Shin, Priyadarshini Malusare and Paul D. Hovland Mathematics and Computer Science Division Argonne National Laboratory Design and Implementation.
3-Valued Logic Analyzer (TVP) Tal Lev-Ami and Mooly Sagiv.
8. Introduction to Denotational Semantics. © O. Nierstrasz PS — Denotational Semantics 8.2 Roadmap Overview:  Syntax and Semantics  Semantics of Expressions.
Generics and the ArrayList Class
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Compiler Construction
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
1 Chapter 7 User-Defined Methods Java Programming from Thomson Course Tech, adopted by kcluk.
FPGA BASED IMAGE PROCESSING Texas A&M University / Prairie View A&M University Over the past few decades, the improvements from machine language to objected.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 9 Pointers and Dynamic Arrays.
Chapter 14 Generics and the ArrayList Class Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Program design example Task: Develop an algorithm expressed in pseudocode for a specified problem specified problem.
Introduction to Intellectual Property using the Federal Acquisitions Regulations (FAR) To talk about intellectual property in government contracting, we.
Connecting AreaDetector to GDA John Hammonds Software Services Group Advanced Photon Source The submitted manuscript has been created by UChicago Argonne,
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Java CourseWinter 2009/10. Introduction Object oriented, imperative programming language. Developed: Inspired by C++ programming language.
Chapter 6—Objects and Classes The Art and Science of An Introduction to Computer Science ERIC S. ROBERTS Java Objects and Classes C H A P T E R 6 To beautify.
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
1 The Architectural Design of FRUIT: A Family of Retargetable User Interface Tools Yi Liu, H. Conrad Cunningham and Hui Xiong Computer & Information Science.
Automatic Identification of Concurrency in Handel-C Joseph C Libby, Kenneth B Kent, Farnaz Gharibian Faculty of Computer Science University of New Brunswick.
Michelle Mills Strout OpenAnalysis: Representation- Independent Program Analysis CCA Meeting January 17, 2008.
Goals of Course Introduction to the programming language C Learn how to program Learn ‘good’ programming practices.
© The McGraw-Hill Companies, 2006 Chapter 4 Implementing methods.
Comp 248 Introduction to Programming Chapter 6 Arrays Part B Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia University,
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Computer Science Department Data Structure & Algorithms Lecture 8 Recursion.
Chapter 6 Programming Languages (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
The basics of the array data structure. Storing information Computer programs (and humans) cannot operate without information. Example: The array data.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
What does a computer program look like: a general overview.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability Objects First with Java - A Practical.
Compiler Principles Fall Compiler Principles Lecture 0: Local Optimizations Roman Manevich Ben-Gurion University.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Evaluating and Improving an OpenMP-based Circuit Design Tool Tim Beatty, Dr. Ken Kent, Dr. Eric Aubanel Faculty of Computer Science University of New Brunswick.
Semantics CSE 340 – Principles of Programming Languages Fall 2015 Adam Doupé Arizona State University
Lesson - 2. Introduction When we make a program we must follow some steps, called Programming Development Life Cycle (PDLC). Programming steps are five:
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming Introduction to simple functions.
Code Motion for MPI Performance Optimization The most common optimization in MPI applications is to post MPI communication earlier so that the communication.
Classes, Interfaces and Packages
Professor A G Constantinides 1 Discrete Fourier Transforms Consider finite duration signal Its z-tranform is Evaluate at points on z-plane as We can evaluate.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Pointers and Dynamic Arrays.
Copyright © 2014 Pearson Addison-Wesley. All rights reserved. Chapter 9 Pointers and Dynamic Arrays.
Chapter – 8 Software Tools.
Recap Introduction to Inheritance Inheritance in C++ IS-A Relationship Polymorphism in Inheritance Classes in Inheritance Visibility Rules Constructor.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Function Templates 16.2.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Recursion,
Operator Overloading Introduction
Pointers and Dynamic Arrays
User-Written Functions
Chapter 7 User-Defined Methods.
EPICS Roadmap Where Do We Go From Here?
Microprocessor and Assembly Language
Array Array is a variable which holds multiple values (elements) of similar data types. All the values are having their own index with an array. Index.
Programmazione I a.a. 2017/2018.
Syntax-Directed Translation
Program Slicing Baishakhi Ray University of Virginia
Algorithm Efficiency Chapter 10.
Java for Beginners University Greenwich Computing At School DASCO
See requirements for practice program on next slide.
Compiler Construction
CS148 Introduction to Programming II
Valuable Lessons from Fuel Cycle Code Comparisons
Compiler Construction
Topic 2b ISA Support for High-Level Languages
Presentation transcript:

In conclusion our tool: can be used with any operator overloading AD package replaces the manual process, which is slow and overestimates the number active variables successfully identifies active variables can change the data type of active variables of most C data types In the future we would like to: Benchmark the tool Add support for C++ Identifying Active Variables to Improve the Performance of Operator Overloading Automatic Differentiation Drew Wicke Argonne National Laboratory INTRODUCTION Results Materials and Methods Discussion Automatic Differentiation (AD) is a means of computing the derivative of a function within a computer program. AD can be performed by using the operator overloading approach which uses features of the programming language to alter the meaning of mathematical operators to compute the derivative. Operator overloading as a means of performing AD allows for maintainable code; however, speed of computation is sacrificed. The goal of this research was to use activity analysis to improve the performance of the calculation of derivatives using Sacado. Sacado is a package in the Trilinos framework and is an implementation in C++ of the operator overloading method of AD. The tool created to accomplish this combines the activity analysis of the source code analysis toolkit, OpenAnalysis, with the source-to-source transformation tool ROSE. CONCLUSION/FUTURE STEPS We encountered challenges in type changing. For example, to change the type of typedef active variables we must extract base type and all other types such as pointers to set to the derivative type. DERIV_TYPE operator* (DERIV_TYPE other) { this->val = this->val() * other.val(); this->dx = this->val() * other.dx() + other- >val() * this->dx(); return *this; } int main(){ double val; val = 4.3; … return 0; } Convert 2. ROSE AST3. OpenAnalysis ICFG 4. Vary Analysis Useful Analysis Activity Analysis int main(){ DERIV_TYPE_double val; val = 4.3; … return 0; } 6. Output generated code Vary variables are those whose value is computed using an independent variable. Useful variables are used to compute the value of the dependent variable Active variables are both vary and useful. Activity Analysis Tool Flow typedef Sacado::Fad::DFad DERIV_TYPE_double; // Sacado derivative type void foo(DERIV_TYPE_double *x, DERIV_TYPE_double *f){ DERIV_TYPE_double squarePoly = (*x) * (*x); DERIV_TYPE_double theConst = 3.14 * 2; DERIV_TYPE_double div = ((*x) / 2); if (squarePoly >= 100) (*f) = div * theConst; else (*f) = div * theConst + 100; } 1. Input Code 5. Change the type of active variables to derivative type The above code illustrates how a Sacado function can be written. All the variables have the Sacado derivative type DERIV_TYPE_double. Both the function and the derivative of the function are computed using overloaded operators, such as the example on the left, when the variables have the Sacado derivative type. Since active variables need only have the derivative type, the code is inefficient due to unnecessary memory allocation and function calls. Above is an example of an overloaded multiplication operator. Not only must the product be computed, but also the value of the derivative after applying the product rule. typedef Sacado::Fad::DFad DERIV_TYPE_double; void foo(DERIV_TYPE_double *x, DERIV_TYPE_double *f){ # pragma $adic_indep,x // specify the independent # pragma $adic_dep,f // and dependent variables double squarePoly = ADValue((*x) * (*x)); double theConst = 3.14 * 2; DERIV_TYPE_double div = ((*x) / 2); if (squarePoly >= 100) (*f) = div * theConst; else (*f) = div * theConst + 100; } After applying the tool to code that has variables with double type variables we get the generated code below. This code is efficient because only the active variables have the Sacado derivative type, DERIV_TYPE_double. // after: typedef double* fir; typedef fir* sec; DERIV_TYPE_double **test; // before: typedef double* fir; typedef fir* sec; sec test; // active Above code shows that we gather double and pointer data types to change the type of test to DERIV_TYPE_double**. The above diagram demonstrates the process through which our tool takes in order to change the types of active variables. 1.Provide code that you want to run the tool on 2.The tool converts the code to an abstract syntax tree (AST) with ROSE 3.AST is converted to a interprocedural control flow graph (ICFG) for OpenAnalysis 4.Using OpenAnalysis perform vary, useful and activity analysis to make a list of active variables 5.Change the active variable’s type to the Sacado derivative type within the AST 6.Output the generated code based off of the AST The submitted manuscript has been created by UChicago Argonne, LLC, Operator of Argonne National Laboratory ("Argonne"). Argonne, a U.S. Department of Energy Office of Science laboratory, is operated under Contract No. DE-AC02-06CH The U.S. Government retains for itself, and others acting on its behalf, a paid-up nonexclusive, irrevocable worldwide license in said article to reproduce, prepare derivative works, distribute copies to the public, and perform publicly and display publicly, by or on behalf of the Government References: Automatic Differentiation: OpenAnalysis: ROSE: Sacado: