Presentation is loading. Please wait.

Presentation is loading. Please wait.

ESMF Code Generation with Cupid Update and Demo October 2009 Rocky Dunlap Spencer Rugaber Leo Mark Georgia Tech College of Computing.

Similar presentations


Presentation on theme: "ESMF Code Generation with Cupid Update and Demo October 2009 Rocky Dunlap Spencer Rugaber Leo Mark Georgia Tech College of Computing."— Presentation transcript:

1 ESMF Code Generation with Cupid Update and Demo October 2009 Rocky Dunlap Spencer Rugaber Leo Mark Georgia Tech College of Computing

2 Goals Cupid supports programmers of numerical Earth System Models by: ▫Raising the level of abstraction so that modelers can think and code in terms of ESM vocabulary—not in terms of low or intermediate level programming constructs ▫Validating coupling configurations at compile time; providing error messages ▫Automatically generating FORTRAN code for coupling Earth System Modeling Framework (ESMF) components

3 Process Overview – Inputs & Outputs You have: ▫Fortran source code for two (or more) ESMF Gridded Components You put in: ▫A description of those components ▫A description of a coupling configuration: composition, schedule, and deployment You get out: ▫Fortran source code for an ESMF driver and an ESMF coupler component

4 Cupid Architecture ESMF Conceptual Model (ECM) ECM Modeling GUI ESMF Conceptual Modeling ESMF Configuration Instance ESMF Configuration Instances (ECIs) ESMF Driver Generator ESMF Code Generation ESMF Coupler Generator Java Fortran Object Model (JFOM) FORTRAN Code Generation JFOM Instances StringTemplateEclipse Modeling Framework (EMF) Textual syntax and text editor (based on Xtext)

5 Cupid Architecture ESMF Conceptual Model (ECM) ECM Modeling GUI ESMF Conceptual Modeling ESMF Configuration Instances (ECIs) ESMF Driver Generator ESMF Code Generation ESMF Coupler Generator Java Fortran Object Model (JFOM) FORTRAN Code Generation JFOM Instances StringTemplateEclipse Modeling Framework (EMF) Textual syntax and text editor (based on Xtext)

6 Cupid Architecture ESMF Conceptual Modeling ESMF Configuration Instances (ECIs) ESMF Driver Generator ESMF Code Generation ESMF Coupler Generator Java Fortran Object Model (JFOM) FORTRAN Code Generation JFOM Instances StringTemplateEclipse Modeling Framework (EMF) Textual syntax and text editor (based on Xtext) ESMF Conceptual Model (ECM) ECM Modeling GUI

7 The ESMF Conceptual Model (ECM) A conceptual model of ESMF API: ▫Gridded and Coupler Component, Import/Export State ▫Virtual Machine, PETs, DELayout ▫DistGrid, Array ▫Field, Grid (partial) ▫Not included (yet): Clock, Calendar Also includes new structures for describing coupling configurations: ▫Composition – how the components are connected ▫Schedule – order of execution of components ▫Deployment – map components to physical resources

8 Graphical Modeling

9 Cupid Architecture ESMF Conceptual Model (ECM) ECM Modeling GUI ESMF Conceptual Modeling ESMF Configuration Instances (ECIs) ESMF Driver Generator ESMF Code Generation ESMF Coupler Generator Java Fortran Object Model (JFOM) FORTRAN Code Generation JFOM Instances StringTemplateEclipse Modeling Framework (EMF) Textual syntax and text editor (based on Xtext)

10 Textual Syntax

11 Cupid Architecture ESMF Conceptual Model (ECM) ECM Modeling GUI ESMF Conceptual Modeling ESMF Configuration Instances (ECIs) ESMF Code Generation Java Fortran Object Model (JFOM) FORTRAN Code Generation JFOM Instances StringTemplateEclipse Modeling Framework (EMF) Textual syntax and text editor (based on Xtext) ESMF Driver Generator ESMF Coupler Generator

12 System Architecture ESMF Conceptual Model (ECM) ECM Modeling GUI ESMF Conceptual Modeling ESMF Configuration Instances (ECIs) ESMF Code Generation FORTRAN Code Generation StringTemplateEclipse Modeling Framework (EMF) Textual syntax and text editor (based on Xtext) ESMF Driver Generator ESMF Coupler Generator Java Fortran Object Model (JFOM) JFOM Instances

13 System Architecture ESMF Conceptual Model (ECM) ECM Modeling GUI ESMF Conceptual Modeling ESMF Configuration Instances (ECIs) ESMF Code Generation FORTRAN Code Generation StringTemplateEclipse Modeling Framework (EMF) Textual syntax and text editor (based on Xtext) ESMF Driver Generator ESMF Coupler Generator Java Fortran Object Model (JFOM) JFOM Instances

14 Building a Coupling Configuration There are two ways to create a coupling configuration (ESMF Configuration Instance): ▫Graphically using a tree-based model editor ▫Using a textual syntax and Eclipse-based editor At the end of the day, both are represented as instances of the ESMF Conceptual Model. ▫The two formats are interchangeable

15 Case Studies ESMF_ArrayRedistSTest ▫Two components, one-way coupling ▫user_model1 populates 100x150 global array ▫user_model2 verifies array data ▫user_model1 runs on 4 processors (PETs) with a 4x1 DELayout (i.e., four 25x150 local arrays) ▫user_model2 runs on 2 PETs with a 1x2 DELayout (i.e., two 100x75 local arrays) ESMF_FieldSparseMatMulSTest ▫Similar to above except data is packaged in Fields and redistribution is done via ESMF_ArraySMM

16 Demo

17 Models and Instances ESMF Conceptual Model (ECM) ESMF Configuration Instance (ECI) Java Fortran Object Model (JFOM) JFOM Instance FORTRAN 90 ISO Standard FORTRAN source code Model level Instance level transform conform

18 Current Status ECM is partially complete (~70%) ▫missing some elements from the ESMF API JFOM is partially complete (~33%) ▫missing FORTRAN constructs Code generator is “rigid” ▫geared toward the two system test cases ▫needs to be stretched with real world models Hurdles ▫How to best represent interpolation weights for Sparse Matrix Multiply.

19 Future Work Examples, examples, examples ▫Need to generate couplers for more realistic models Discussions with modelers/scientists ▫How can code generation increase productivity, simplify coding, and enhance model understanding? Coupling in general ▫What are the hard parts of coupling models? How can this system address them?

20 Thanks! Questions? code generation Springtime has finally come a happy climate

21 Additional slides

22 Existing Infrastructure Pieces Eclipse Modeling Framework ▫http://www.eclipse.org/emf/http://www.eclipse.org/emf/ ▫“…a modeling framework and code generation facility for building tools and other applications based on a structured data model” ▫Models are built using a UML-like, object-oriented metamodel called Ecore StringTemplate ▫http://www.stringtemplate.org/http://www.stringtemplate.org/ ▫a Java-based template engine for generating formatted text output ▫templates are strings with “holes” that can be populated programmatically and then output

23 JFOM: Fortran Conceptual Model ECIs are input to the code generation phase. We need an API for manipulating Fortran programs. Java Fortran Object Model (JFOM) ▫built with the Eclipse Modeling Framework ▫a set of Java classes that represent the syntactic structures of Fortran programs ▫based on the Fortran 90 grammar ▫allows programmatic manipulation of Fortran programs JFOM instances are serialized with StringTemplate

24 JFOM Classes JFOM classes represent the syntactic structures of Fortran 90

25 Generated Code Examples Examples of generated code can be found here: http://swiki.cc.gatech.edu:8080/Curator/49


Download ppt "ESMF Code Generation with Cupid Update and Demo October 2009 Rocky Dunlap Spencer Rugaber Leo Mark Georgia Tech College of Computing."

Similar presentations


Ads by Google