Cupid: A Smart Development Environment for Earth System Models Rocky Dunlap research sponsored by NASA/ROSES 1.

Slides:



Advertisements
Similar presentations
CS3012: Formal Languages and Compilers Static Analysis the last of the analysis phases of compilation type checking - is an operator applied to an incompatible.
Advertisements

ESMF-based applications with the National Unified Operational Prediction Capability Tim Campbell Naval Research Laboratory.
Semantics Static semantics Dynamic semantics attribute grammars
Feature Analysis of Coupling Technologies for Climate Models Spencer Rugaber, Rocky Dunlap and Leo Mark College of Computing Georgia Institute of Technology.
Round-trip Engineering of Eclipse Plug-ins using Eclipse Workbench Part Interaction FSML Michał Antkiewicz, Krzysztof Czarnecki {mantkiew,
UML CASE Tool. ABSTRACT Domain analysis enables identifying families of applications and capturing their terminology in order to assist and guide system.
Establishing the overall structure of a software system
Chapter 3 Program translation1 Chapt. 3 Language Translation Syntax and Semantics Translation phases Formal translation models.
Chapter 10 Class and Method Design
Type Inference: CIS Seminar, 11/3/2009 Type inference: Inside the Type Checker. A presentation by: Daniel Tuck.
Slide 1 Chapter 10 Class and Method Design. Slide 2 REVISITING THE BASIC CHARACTERISTICS OF OBJECT-ORIENTATION.
IBM Software Group © 2005 IBM Corporation University of Nantes Eclipse dayMarch 2005 The Eclipse Modeling Framework and the IBM Model Transformation Framework.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Examining the Code [Reading assignment: Chapter 6, pp ]
Interim Review Cupid: An IDE for Model Development and Modeler Training Cecelia DeLuca 1, Rocky Dunlap 2, Spencer Rugaber 2 1 NOAA ESRL/University of Colorado.
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
Knowledge Mediation in the WWW based on Labelled DAGs with Attached Constraints Jutta Eusterbrock WebTechnology GmbH.
Session 3: NUOPC Interoperability Layer Instructors: Rocky Dunlap and Fei Liu NOAA Cooperative Institute for Research in Environmental Sciences University.
Sumant Tambe, et. al LEESA DSPD 2008 An Embedded Declarative Language for Hierarchical Object Structure Traversal Sumant Tambe* Aniruddha Gokhale Vanderbilt.
An Approach and Tool for Synchronous Refactoring of UML Diagrams and Models Using Model-to-Model Transformations Hafsteinn Þór Einarsson Helmut Neukirchen.
C++ Object Oriented 1. Class and Object The main purpose of C++ programming is to add object orientation to the C programming language and classes are.
Reusable Code For Your Appx Processes Presented By: Gary Rogers.
A Generative and Model Driven Framework for Automated Software Product Generation Wei Zhao Advisor: Dr. Barrett Bryant Computer and Information Sciences.
Sumant Tambe, et. al LEESA DSPD 2008 An Embedded Declarative Language for Hierarchical Object Structure Traversal Sumant Tambe* Aniruddha Gokhale Vanderbilt.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 13Slide 1 Architectural Design u Establishing the overall structure of a software system.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Chapter 10 Architectural Design.
© Bertrand Meyer and Yishai Feldman Notice Some of the material is taken from Object-Oriented Software Construction, 2nd edition, by Bertrand Meyer (Prentice.
Introduction to MDA (Model Driven Architecture) CYT.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
ESMF Code Generation Rocky Dunlap Spencer Rugaber Leo Mark Georgia Tech College of Computing.
Reviewing Recent ICSE Proceedings For:.  Defining and Continuous Checking of Structural Program Dependencies  Automatic Inference of Structural Changes.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 4, Requirements Elicitation.
Exploring an Open Source Automation Framework Implementation.
Tammy Dahlgren with Tom Epperly, Scott Kohn, and Gary Kumfert Center for Applied Scientific Computing Common Component Architecture Working Group October.
Hyper/J and Concern Manipulation Environment. The need for AOSD tools and development environment AOSD requires a variety of tools Life cycle – support.
Software Engineering Principles Principles form the basis of methods, techniques, methodologies and tools Principles form the basis of methods, techniques,
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CESM/ESMF Progress Report Mariana Vertenstein NCAR Earth System Laboratory CESM Software Engineering Group (CSEG) NCAR is sponsored by the National Science.
1 5 Nov 2002 Risto Pohjonen, Juha-Pekka Tolvanen MetaCase Consulting AUTOMATED PRODUCTION OF FAMILY MEMBERS: LESSONS LEARNED.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
ESMF Code Generation with Cupid Update and Demo October 2009 Rocky Dunlap Spencer Rugaber Leo Mark Georgia Tech College of Computing.
1 Typing XQuery WANG Zhen (Selina) Something about the Internship Group Name: PROTHEO, Inria, France Research: Rewriting and strategies, Constraints,
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
Object Oriented Analysis and Design 1 Chapter 9 From Design to Implementation  Implementation Model  Forward, Reverse, and Round-Trip Engineering  Mapping.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 4 Slide 1 Software Processes.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
Basic Concepts and Definitions
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
State of ESMF: The NUOPC Layer Gerhard Theurich NRL/SAIC ESMF Executive Board / Interagency Working Group Meeting June 12, 2014.
2000 Research Overview Dr. Kim Mens Programming Technology Lab Vrije Universiteit Brussel.
Nesting Milestone Materials Nesting design document Updated NUOPC Layer software prototype bundled with ESMF Updated NUOPC Layer reference manual Nesting.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Slide 1 Chapter 8 Architectural Design. Slide 2 Topics covered l System structuring l Control models l Modular decomposition l Domain-specific architectures.
Generating ADL Descriptions ADL Module for Together 6.x Massimo Marino Lawrence Berkeley National Laboratory.
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
Mechanisms for Requirements Driven Component Selection and Design Automation 최경석.
CHESS Methodology and Tool Federico Ciccozzi MBEES Meeting Sälen, January 2011 January 2011.
LECTURE 10 Semantic Analysis. REVIEW So far, we’ve covered the following: Compilation methods: compilation vs. interpretation. The overall compilation.
SDN controllers App Network elements has two components: OpenFlow client, forwarding hardware with flow tables. The SDN controller must implement the network.
TIM 58 Chapter 8: Class and Method Design
Program Slicing Baishakhi Ray University of Virginia
Software Architecture & Design
Presentation transcript:

Cupid: A Smart Development Environment for Earth System Models Rocky Dunlap research sponsored by NASA/ROSES 1

ESMF/NUOPC A framework for constructing earth system models from components Hierarchical architecture Functions for coupling and data exchange, including representing numerical grids and interpolation 2 A layer on top of ESMF Standardized way of using ESMF to promote a common model architecture Generic components that can be specialized

Adopting a Scientific Framework Scientific frameworks provide: – an overall structure for the application – reusable, domain-specific functionality Adopting a scientific framework requires: – understanding the framework API – writing framework completion code to implement framework concepts – respecting framework constraints 3

Framework Specific Modeling Languages Explicit encoding of domain-specific concepts provided by a framework API Framework concepts are mapped to code patterns Two-way mapping: – Reverse engineering of existing code – Forward engineering - code generation 4 Antkiewicz, Michał, and Krzysztof Czarnecki. "Framework-specific modeling languages with round-trip engineering." Model Driven Engineering Languages and Systems (2006):

source code editorframework-specific model 5

6 NUOPC Model Implements Set Services Calls Generic Set Services Registers Init Phase 1 Registers Init Phase 2 Implements Init Phase 1 Framework Completion Code Framework Specific Modeling Language Name

Structural Mapping Types 7 Structural Pattern ExpressionStructural Elements Matched module Matches a Fortran module m moduleName Matches the name of the module m m subroutine Matches a subroutine defined inside module m m subroutine: “name(type1, type2,...)” or m subroutine: “*(*)” Matches a subroutine defined inside module m with the given signature. The wildcard * can be used in place of the name and/or types. s subroutineName Matches the name of subroutine s s formalParam: i Matches the i th formal parameter of subroutine s

Structural Mapping Types (cont) 8 Structural Pattern ExpressionStructural Elements Matched s call Matches a subroutine call within the implementation of subroutine s s call: “name” [definedInModule: “moduleName”] Matches a subroutine call within the implementation of subroutine s to a subroutine with the given name. Optionally restricts matches to subroutines defined in a certain named module. c argValByIndex: i Matches the i th argument value for the call c c argValByKeyword: “keyword” Matches the value of the argument with the given keyword for the call c

Mappings 8 NUOPC Model Implements Set Services Calls Generic Set Services Registers Init Phase 1 Registers Init Phase 2 Implements Init Phase 1 module subroutine: “*(type(ESMF_GridComp), integer)” call: “routine_SetServices” definedInModule: “NUOPC_Model” subroutine: “*(type(ESMF_GridComp), type(ESMF_State), type(ESMF_State), type(ESMF_Clock), integer)” Name subroutineName Registers Init Phase 0 call: “ESMF_GridCompSetEntryPoint” Implements Init Phase 0... call: “ESMF_GridCompSetEntryPoint” subroutine: “*(type(ESMF_GridComp), type(ESMF_State), type(ESMF_State), type(ESMF_Clock), integer)”

Constraints 8 NUOPC Model Implements Set Services Calls Generic Set Services Registers Init Phase 1 Registers Init Phase 2 Implements Init Phase 1 module subroutine: “*(type(ESMF_GridComp), integer)” call: “routine_SetServices” definedInModule: “NUOPC_Model” subroutine: “*(type(ESMF_GridComp), type(ESMF_State), type(ESMF_State), type(ESMF_Clock), integer)” Name subroutineName Registers Init Phase 0 call: “ESMF_GridCompSetEntryPoint” Implements Init Phase 0... call: “ESMF_GridCompSetEntryPoint” subroutine: “*(type(ESMF_GridComp), type(ESMF_State), type(ESMF_State), type(ESMF_Clock), integer)” [1] ![1] [0..1] [1] [0..1] [1] required by framework (violations allowed during development) optional by framework required by framework AND essential to match set services (never violated)

Another Part of the FSML Implements Init Phase 1 importStateParam exportStateParam advertisesImportField addsToState addsToImportState standardName subroutine: “*(type(ESMF_GridComp), type(ESMF_State), type(ESMF_State), type(ESMF_Clock), integer)” formalParam: 2 formalParam: 3 call: NUOPC_StateAdvertiseField argValByIndex: 1 OCL: self.addsToState == self.parent.importStatePa ram argValByKeyword: “StandardName” [1] [0..*] [1] ![1] [1] essential path expression derived

Partial Code for Init Phase 1 12

Making the FSML More Concise Implements Init Phase 1 importStateParam exportStateParam advertisesImportField addsToState addsToImportState standardName subroutine: “*(type(ESMF_GridComp), type(ESMF_State), type(ESMF_State), type(ESMF_Clock), integer)” formalParam: 2 formalParam: 3 call: NUOPC_StateAdvertiseField argValByIndex: 1 argValByIndex: 1 sameAs: (../../ formalParam: 2) argValByKeyword: “StandardName” [1] [0..*] [1] ![1] [1] embedded path expression

14 module atm use ESMF use NUOPC use NUOPC_Model subroutine setservices(gcomp, rc).... end subroutine subroutine advance(gcomp, rc).... end subroutine.... end module parse Virtual Program Graph & Abstract Syntax Tree rewrite code queries code transformations Photran Eclipse Plugin Realize Bi-directional Mappings

Status FSML concepts: – NUOPC Model, Set Services, Init Phase 1, Init Phase 2, Advertise Import/Export Field, Realize Import/Export Field, Attach Model Advance method Mappings: defined on as “as needed” basis – Code queries for every mapping (reverse dir.) – Only a few code transformations (forward dir.) 15

Issues & Opportunities Dealing with different versions of the framework, API releases, etc. FSML: Should we take a coarse-grained or fine- grained approach? – coarse-grained: Full architecture of NUOPC application; Models, Mediators, Connectors, etc. – fine-grained: Focus on NUOPC Model with high detail Limitations of static analysis – How far will it take us? – Inclusion of control flow hints for the user: conditionals and loops – How would this tool work in a dynamic environment? 16

Old Slides 17

Constraints 8 NUOPC Model Implements Set Services Calls Generic Set Services Registers Init Phase 1 Registers Init Phase 2 Implements Init Phase 1 Name Registers Init Phase 0 [1] ![1] [0..1] [1] Implements Init Phase 0 [0..1] [1]... [1] required by framework (violations allowed during development) required by framework AND essential in order to match parent feature (never violated) optional by framework

19

Image taken from Figure 2 of: Antkiewicz, Michał, and Krzysztof Czarnecki. "Framework-specific modeling languages with round-trip engineering." Model Driven Engineering Languages and Systems (2006):

Synchronization States and Reconciliation (Antkiewicz) synchronization state: forward addition – a feature added to the asserted model – e.g., a new import field is advertised reconciliation decision: enforce – make code consistent with asserted model – e.g., adds calls to NUOPC_StateAdvertiseField() 21

Synchronization States and Reconciliation (Antkiewicz) synchronization state: reverse removal – a feature removed from code – e.g., call to NUOPC_StateRealizeField() removed reconciliation decision: update – make asserted model consistent with code – e.g., remove realize field feature from asserted model key features used to match concepts between code and model – e.g., use field short name because they are unique 22

Forward Engineering (Antkiewicz) Example feature (variation point): – advertise import field “sea_surface_temperature” Code transformations – need to add a call to: NUOPC_StateAdvertiseField(importState, StandardName=“sea_surface_temperature”, rc=rc) – where to add the call (initialize phase 1) how to determine which subroutine? (e.g., look at SetServices?) what if it doesn’t exist? (e.g., add it automatically?) – name of import state parameter (second parameter of subroutine) – add error checking calls? (need to know name of rc parameter) 23

Reverse Engineering (Antkiewicz) Start with existing source code (e.g., a Fortran module) Code queries used to build model – Question: Is the Fortran module a NUOPC Model? – Does it use ESMF, NUOPC, and NUOPC_Model? Is this enough? – Does it have a SetServices that calls the generic NUOPC_Model routine_SetServices() Keep it mind it could have an alias, e.g., model_routine_SetServices() Support for partial concepts – e.g., this is a NUOPC_Model but it fails to call the generic routine_setServices() method – required because we are helping the user to build up implementation incrementally 24

25 Partial Framework Specific Modeling Language for NUOPC Name of model True if module uses ESMF, NUOPC, NUOPC_Model Maps to a Fortran module Reference Maps to subroutine True if has correct parameter types (gcomp, rc) True if calls routine_SetServices in NUOPC_Model True if sets entry point for init phase 1, 2

Code Queries 26

Candidates / False Positives Goal: Given code for a (partial) NUOPC Model, find the SetServices routine Initially ALL subroutines in the module are candidates Look for clues: – parameter types (ESMF_GridComp, Integer) – calls to routine_SetServices() in NUOPC_Model – calls to ESMF_GridCompSetServices() – calls to ESMF_MethodAdd() 27

28 Has 2 parameters of type ESMF_Grid and Integer Calls routine_SetServices() Calls ESMF_GridCompSetServices() If there is ONE subroutine here, it is likely the right one. BUT, if there are ZERO subroutines, then we have to consider other CANDIDATES.