1 / 19

Turning ESMF Components into CCA Components

Turning ESMF Components into CCA Components. Arlindo da Silva, NASA/GSFC Data Assimilation Office Shujia Zhou , TASC & NASA ESTO CT Data Assimilation Office, NASA/GSFC. Components Workshop, GFDL, 14 May 2003. Acknowledgements.

marty
Download Presentation

Turning ESMF Components into CCA Components

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. Turning ESMF Components into CCA Components Arlindo da Silva, NASA/GSFC Data Assimilation Office Shujia Zhou, TASC & NASA ESTO CT Data Assimilation Office, NASA/GSFC Components Workshop, GFDL, 14 May 2003

  2. Acknowledgements • Portions adapted from CCA Forum Tutorial of 15 Jan 2003 available from: • http://www.cca-forum.org/tutorials/ • CCA Forum Tutorial WG • Rob Armstrong, David Bernholdt, Wael Elwasif, Lori Freitag, Dan Katz, Jim Kohl, Gary Kumfert, Lois Curfman McInnes, Boyana Norris, Craig Rasmussen, Jaideep Ray, Torsten Wilde • ANL, JPL, LANL, LLNL, ORNL, SNL Arlindo da Silva/Shujia Zhou

  3. Outline • Goals of the project • What is Common Component Architecture (CCA)? • Overview of key CCA concepts • ESMF components in a nutshell • Language interoperability issues • Prototype: simple “ocean/atmosphere” coupled system • Next step: Cane-Zebiak model Arlindo da Silva/Shujia Zhou

  4. Goals of the Project • Given Earth system models developed under Earth System Modeling Framework (ESMF), explore interoperability with alternative architectures, in particular • Common Component Architecture (CCA) • Use CCA-compliant framework such as Ccaffeine to assemble climate applications based on ESMF components, carrying out sample simulations • Document process of turning ESMF components into CCA components Arlindo da Silva/Shujia Zhou

  5. Component Architectures • Existing component architecture standards such as CORBA, COM/DCOM, and JavaBeans/EJB, are widely used in commercial industry. • They do not support efficient parallel communication channels between components • Existing high-performance frameworks such as POOMA and Overture are object-oriented, but are not based on peer components • Rather, components are viewed as elements in an inheritance hierarchy Arlindo da Silva/Shujia Zhou

  6. What is the CCA? • A component model specifically designed for high-performance computing • Support HPC languages (Babel) • Support parallel as well as distributed execution models • Minimize performance overhead • Minimalist approach makes it easier to componentize existing software • Component interactions are not merely dataflow • Components are peers • No particular component assumes it is “in charge” of the others. • Allows the application developer to decide what is important. Arlindo da Silva/Shujia Zhou

  7. CCA Concepts: Ports • Components interact through well-defined interfaces, or ports • In OO languages, a port is a class or interface • In Fortran, a port is a bunch of subroutines or a module • Components may provideports – implement the class or subroutines of the port • Components may useports – call methods or subroutines in the port • Links denote a caller/callee relationship, not dataflow! • e.g., FunctionPort could contain: evaluate(in Arg, out Result) IntegratorPort FunctionPort FunctionPort MidpointIntegrator NonlinearFunction Arlindo da Silva/Shujia Zhou

  8. Components and Ports in the Integrator Example FunctionPort IntegratorPort FunctionPort NonlinearFunction FunctionPort MidpointIntegrator GoPort IntegratorPort LinearFunction FunctionPort Driver IntegratorPort FunctionPort PiFunction RandomGeneratorPort RandomGeneratorPort MonteCarloIntegrator RandomGenerator Arlindo da Silva/Shujia Zhou

  9. An Application Built from the Example Components FunctionPort IntegratorPort FunctionPort NonlinearFunction FunctionPort MidpointIntegrator GoPort IntegratorPort LinearFunction FunctionPort Driver IntegratorPort FunctionPort PiFunction RandomGeneratorPort RandomGeneratorPort MonteCarloIntegrator RandomGenerator Arlindo da Silva/Shujia Zhou

  10. Another Application… FunctionPort IntegratorPort FunctionPort NonlinearFunction FunctionPort MidpointIntegrator GoPort IntegratorPort LinearFunction FunctionPort Driver IntegratorPort FunctionPort PiFunction RandomGeneratorPort RandomGeneratorPort MonteCarloIntegrator RandomGenerator Arlindo da Silva/Shujia Zhou

  11. And Many More… Dashed lines indicate alternate connections FunctionPort IntegratorPort FunctionPort NonlinearFunction FunctionPort MidpointIntegrator GoPort IntegratorPort LinearFunction FunctionPort Driver IntegratorPort FunctionPort PiFunction RandomGeneratorPort RandomGeneratorPort MonteCarloIntegrator Create different applications in "plug-and-play" fashion RandomGenerator Arlindo da Silva/Shujia Zhou

  12. CCA Frameworks • The framework provides the means to “hold” components and compose them into applications • The framework is often application’s “main” or “program” • Frameworks allow exchange of ports among components without exposing implementation details • Frameworks provide a small set of standard services to components • BuilderServices allow programs to compose CCA apps • Frameworks may make themselves appear as components in order to connect to components in other frameworks Arlindo da Silva/Shujia Zhou

  13. The Lifecycle of a CCA Component • User instructs framework to load and instantiate components • User instructs framework to connect uses ports to provides ports • Code in components uses functions provided by another component • Ports may be disconnected • Component may be destroyed Arlindo da Silva/Shujia Zhou

  14. CCA Concepts: Direct Connection • Components loaded into separate namespaces in the same addressspace (process) from shared libraries • getPort call returns a pointer to the port’s function table • Calls between components equivalent to a C++ virtual function call: lookup function location, invoke • Cost equivalent of ~2.8 F77 or C function calls Arlindo da Silva/Shujia Zhou

  15. ESMF Components • ESMF Gidded Components are most likely implemented in F90, e.g. Module ATM_GridComp Public: ATM_SetServices() Private: ATM_Initialize() ATM_Run() ATM_Finalize() These are saved In function pointer Table by ATM_SetServices() Arlindo da Silva/Shujia Zhou

  16. ESMF F90 Application • User code is called via ESMF routines of similar name Type(ESMF_GridComp) :: gcATM gcATM = ESMF_GridCompCreate() Call ESMF_GridCompSetServices(gcATM,…) Call ESMF_GridCompInitialize(gcATM,…) Call ESMF_GridCompRun(gcATM,…) Call ESMF_GridCompFinalize(gcATM,…) • C++ bindings exist for each ESMF_* rountine • Therefore, a C++ interface automatically exists for any user written F90 component Arlindo da Silva/Shujia Zhou

  17. ESMF on CCA: Approach • Use ESMF language interoperability feature to interface to CCA in C++ • No need to instrument user code with complex BABEL machinery (F90 not yet supported), or CHASM • For a typical ocean-atmosphere coupled system one needs to write CCA wrappers for 4 components: • Gridded Components: OCN, ATM • Couplers: OCNxATM, ATMxOCN Arlindo da Silva/Shujia Zhou

  18. Wrapping an ESMF Component for CCA CCA_Comp ESMC_Comp FTable CCA_Driver ESMC_CompInitialize ESMC_CompRun ESMC_CompFinalize ATM->Run() ATM is the instance of CCA_ESMF_Comp CCA_Comp is assembled with ESMF utilities and is compiled as .so User_ATM User_ATMInitialize User_ATMRun User_ATMFinalize Arlindo da Silva/Shujia Zhou

  19. Component Relationship via CCA Wiring ATM OCN Port link Data flow

More Related