1 / 31

Cupid A Domain Specific Language for Coupled ESMs

Cupid A Domain Specific Language for Coupled ESMs. Rocky Dunlap Coupling Workshop 2013. Second Workshop on Coupling Technologies for Earth System Modeling NCAR, Boulder, Colorado, February 20-22, 2013. Outline. Motivation and Goals of Cupid Overview and Current Status Example Application

lisbet
Télécharger la présentation

Cupid A Domain Specific Language for Coupled ESMs

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. CupidA Domain Specific Language for Coupled ESMs Rocky Dunlap Coupling Workshop 2013 Second Workshop on Coupling Technologies for Earth System Modeling NCAR, Boulder, Colorado, February 20-22, 2013

  2. Outline • Motivation and Goals of Cupid • Overview and Current Status • Example Application • Evaluation and Challenges • Future Work

  3. Motivation and Goals • Earth System Modeling software is highly complex • Much effort is spent dealing with accidental details of parallel programming, array manipulations, etc. • Goal of Cupid: Provide significant increases in modeler productivity by raising the level of abstraction of the coupling aspects of ESMs.

  4. Different Kinds of Performance days simulated per hour papers published model scalability modeler productivity # of nodes hours of effort

  5. How does the form of code reuse affect developer productivity?

  6. Cupid Overview Black box Black box Black box Black box White box Coupling Specification (Cupid DSL) Generated Application (Fortran 90) Executable Cupid Compiler Fortran Compiler Maintenance Maintenance link ESMF

  7. Domain Model and Constraints self.fieldConnection->forAll( srcField.scope = self.srcComponent and dstField.scope = self.dstComponent)

  8. Cupid Compiler [template public genESMFInitMethod(c : ESMFGriddedComponent)] subroutine init_(comp, istate, ostate, clock, rc) type(ESMF_GridComp) :: comp type(ESMF_State) :: istate type(ESMF_State) :: ostate type(ESMF_Clock) :: clock integer, intent(out) :: rc ... [for (field : ESMFField | c.item->filter(ESMFField))] [field.name/] = ESMF_FieldCreate(grid=[field.grid.name/], arrayspec=[field.arraySpec.name/], & indexflag=[field.index/], & totalLWidth=[toFortranArrayConstructor(field.totalLWidth)/], & totalUWidth=[toFortranArrayConstructor(field.totalUWidth)/], & name="[field.name/]", rc=rc) [/for] ... [/template] MOF Model to Text Transformation Language (OMG) http://www.omg.org/spec/MOFM2T/1.0/

  9. Eclipse-based Implementation Eclipse Modeling Framework EcoreMetamodel Photran Editor Acceleo Model to Text

  10. Current Status Calls can be generated to ~10% of API methods. 11 of 23 ESMF types represented in DSL.

  11. Case Study: ESMF Coupled Flow Demo

  12. Caution: Some coding required! Inserted Code • reading namelists, setting parameters • set up initial conditions and boundary conditions • field updates for each timestep • calls to halo operations • Modified Code • grid coordinates • grid inheritance • Generated Code • static superstructure • instantiation of components, states, and fields • populating import and export states • calls to child components • coupler component (redist or regrid) • freeing memory

  13. Challenge: DSL Integration • How to integrate with scientific code? • Possible solutions: • Skeleton approach • Developer fills in science implementation • Model interface approach • A set of Fortran subroutines with model fields as subroutine arguments (à la BFG) • Define interfaces using Scientific Interface Description Language (SIDL) • Self-describing models (à la CSDMS BMI)

  14. Challenge: Representing Behavior • Static structural aspects are fairly easy to model • Parent-child relationship of components • Behavioral (dynamic) aspects are more difficult • Populating an ESMF State object with different fields during different points of model execution • Possible solutions • make behaviors implicit (e.g., all fields added during init, remain unchanged during run, removed during finalize) • introduce a behavioral modeling language (adds complexity!)

  15. Conclusion DSL approach is viable for specifying some parts of the coupling infrastructure. Superstructure Components and their composition; driving Different approaches and different tools are required to raise the abstraction level of each of these parts. Science Field updates based on discrete form of PDEs Infrastructure Building blocks: grids, distributed fields, clocks, regrid, redistribution, I/O, configuration, etc.

  16. Future Work • Cupid: An IDE for Model Development and Modeler TrainingNASA Computational Modeling Algorithms and Cyberinfrastructure (CMAC) Program • Team • Georgia Institute of Technology (Dunlap/Mark/Rugaber) • University of Colorado/CIRES (DeLuca) • NASA Software Systems Support Office (Clune) • NASA GISS (Schmidt) • Extend and harden existing DSL+generator into a student training environment for rapidly developing ESMF-based applications • Incorporate more IDE features, including linking with an execution environment • Modularize Model E and demonstrate in IDE

  17. Thanks!

  18. Domain Specific LanguagesIncrease Productivity • Nokia [1] mobile phone app development • 1000% increase in productivity • “shift focus from code to design” • “In many cases, we can generate 100% of the required code.” • US Air Force Military Command and Control Systems [2] • 300% increase in productivity • Lucent Product Family development [3] • initial productivity factor 3x-5x; 10x productivity increase for experts • graphical DSLs more successful than textual

  19. Reuse Techniques Compositional (library, components, frameworks) Generative (domain-specific languages) System Specification Generator

  20. Hybrid Approach Coupling Specification Generator 22

  21. Challenge: Domain Model • There is no universal domain model for coupling • SQL came about after a formal definition of relational databases • Common Information Model (CIM)  currently defined as retrospective metadata • Jay Larson’s theory of coupling [4]

  22. Analysis Approach: Extract DSL from an existing system Domain Model Core Language Model Earth System Modeling Framework (ESMF) Language Model Constraints Behavioral Model Strembeck, Mark, and UweZdun. "An approach for the systematic development of domain‐specific languages." Software: Practice and Experience 39.15 (2009): 1253-1292.

  23. You Have Already Used DSLs

  24. What kinds of domains benefit from DSLs? Domain characteristic Evidence in ESM domain Sprinkle, Jonathan, et al. "Guest Editors' Introduction: What Kinds of Nails Need a Domain-Specific Hammer?." IEEE Software 26.4 (2009): 15-18.

  25. Core Language Model

  26. Core Language Model

  27. Object Constraint Language self.fieldConnection->forAll( srcField.scope = self.srcComponent and dstField.scope = self.dstComponent)

  28. Implementation – Language Model • Language model using Eclipse-based tools • classes, generalization/ specialization, abstract classes • type system • object references, containment • OCL constraints via annotations • automatic generation of model editor GUI

  29. References Kelly, Steven, and Juha-PekkaTolvanen. "Visual domain-specific modeling: Benefits and experiences of using metaCASE tools." International workshop on Model Engineering, European Conference on Object-Oriented Programming (ECOOP) ed. J. Bezivin, J. Ernst. 2000. Kieburtz, Richard B., et al. "A software engineering experiment in software component generation." Proceedings of the 18th international conference on Software engineering. IEEE Computer Society, 1996. Weiss, D. M., and C. T. R. Lai. "Software product line engineering: a family based software engineering process." (1999). J. Walter Larson, "Ten organising principles for coupling in multiphysics and multiscale models," ANZIAM J., 48, C1090-C1111 (2009).

More Related