1 / 25

ESMF Code Generation with Cupid Update and Demo October 2009

ESMF Code Generation with Cupid Update and Demo October 2009. Rocky Dunlap Spencer Rugaber Leo Mark Georgia Tech College of Computing. Goals. Cupid supports programmers of numerical Earth System Models by:

gail
Download Presentation

ESMF Code Generation with Cupid Update and Demo October 2009

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ESMF Code Generationwith CupidUpdate and DemoOctober 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 Textual syntax and text editor (based on Xtext) ESMF Code Generation ESMF Coupler Generator JFOM Instances JFOM Instances JFOM Instances ESMF Driver Generator FORTRAN Code Generation ESMF Conceptual Modeling ESMF Configuration Instance ESMF Configuration Instance ESMF Configuration Instances (ECIs) ECM Modeling GUI Java Fortran Object Model (JFOM) ESMF Conceptual Model (ECM) StringTemplate Eclipse Modeling Framework (EMF)

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

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

  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 Textual syntax and text editor (based on Xtext) ESMF Code Generation ESMF Coupler Generator ESMF Driver Generator FORTRAN Code Generation ESMF Conceptual Modeling ESMF Configuration Instances (ECIs) JFOM Instances ECM Modeling GUI Java Fortran Object Model (JFOM) ESMF Conceptual Model (ECM) StringTemplate Eclipse Modeling Framework (EMF)

  10. Textual Syntax

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

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

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

  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) Java Fortran Object Model (JFOM) FORTRAN 90 ISO Standard Model level conform ESMF Configuration Instance (ECI) JFOM Instance FORTRAN source code Instance level transform transform

  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/ • “…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/ • 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

More Related