CCA Common Component Architecture CCA Forum Tutorial Working Group Language Interoperable.

Slides:



Advertisements
Similar presentations
Institute of Computer Science AGH Towards Multilanguage and Multiprotocol Interoperability: Experiments with Babel and RMIX Maciej Malawski, Daniel Harężlak,
Advertisements

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 12 Introduction to ASP.NET.
Common Object Request Broker Architecture (CORBA) By: Sunil Gopinath David Watkins.
Tammy Dahlgren, Tom Epperly, Scott Kohn, and Gary Kumfert Center for Applied Scientific Computing Common Component Architecture Working Group October 3,
CS 4800 By Brandon Andrews.  Specifications  Goals  Applications  Design Steps  Testing.
6/11/2015Page 1 Web Services-based Distributed System B. Ramamurthy.
Divorcing Language Dependencies from a Scientific Software Library Gary Kumfert, with Scott Kohn, Jeff Painter, & Cal Ribbens LLNLVaTech.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
TerascaleSimulation Tools and Technologies Tutorial: Presenter Institution.
CORBA Programming Using ACE/TAO
Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
Center for Component Technology for Terascale Simulation Software 122 June 2002Workshop on Performance Optimization via High Level Languages and Libraries.
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
Gary Kumfert with Bill Bosl, Tammy Dahlgren, Tom Epperly, Scott Kohn, & Steve Smith Achieving Language Interoperability with.
CCA Port, Component & Application Build Skeleton Templates “A new script toolkit for generating CCA build skeletons” Torsten Wilde and James Kohl Oak Ridge.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
CCA Common Component Architecture CCA Forum Tutorial Working Group Language Interoperable.
A Hybrid Decomposition Scheme for Building Scientific Workflows Wei Lu Indiana University.
Tamara Dahlgren, Tom Epperly, Scott Kohn, & Gary Kumfert Center for Applied Scientific Computing.
CCA Common Component Architecture 1**1** Components for High Performance Computing: Common Component Architecture Rob Armstrong & CCA Working.
1 CCA Meeting, Januray 25th 2007 Supporting the Master-Worker Paradigm in the Common Component Architecture Hinde Lilia Bouziane, Christian Pérez, Thierry.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
CCA Common Component Architecture CCA Forum Tutorial Working Group 1 Welcome to the Common.
Java Introduction to JNI Prepared by Humaira Siddiqui.
By Noorez Kassam Welcome to JNI. Why use JNI ? 1. You already have significantly large and tricky code written in another language and you would rather.
CCA Common Component Architecture CCA Forum Tutorial Working Group Contributors: Language Interoperability Using Gary.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
Tammy Dahlgren with Tom Epperly, Scott Kohn, and Gary Kumfert Center for Applied Scientific Computing Common Component Architecture Working Group October.
Grid Computing Research Lab SUNY Binghamton 1 Plans for Babelizing XCAT-C++ Madhu Govindaraju Kenneth Chiu.
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
CCA Common Component Architecture CCA Forum Tutorial Working Group Introduction to the Ccaffeine.
Introduction to COM and ActiveX Controls. What is an object? In the Fayad sense of the word.
Grid Computing Research Lab SUNY Binghamton 1 XCAT-C++: A High Performance Distributed CCA Framework Madhu Govindaraju.
1 Cisco Unified Application Environment Developers Conference 2008© 2008 Cisco Systems, Inc. All rights reserved.Cisco Public Introduction to Etch Scott.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
SCIRun and SPA integration status Steven G. Parker Ayla Khan Oscar Barney.
CORBA/IDL Common Object Resource Broker Architecture (CORBA) Interface Definition Language (IDL) Object Management Group (OMG) ( Specification.
Extreme! Computing Lab, Dept. of Computer Science, Indiana University 1 Programming the Grid with Components Madhu Govindaraju Aleksander Slominski Dennis.
Tammy Dahlgren, Tom Epperly, Scott Kohn, & Gary Kumfert.
Scott Kohn with Tammy Dahlgren, Tom Epperly, and Gary Kumfert Center for Applied Scientific Computing Lawrence Livermore National Laboratory October 2,
Update on CORBA Support for Babel RMI Nanbor Wang and Roopa Pundaleeka Tech-X Corporation Boulder, CO Funded by DOE OASCR SBIR.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
CCA Common Component Architecture CCA Forum Tutorial Working Group CCA Status and Plans.
CCA Common Component Architecture CCA Forum Tutorial Working Group 1 Welcome to the Common.
Getting Started with SIDL using the ANL SIDL Environment (ASE) ANL SIDL Team MCS Division, ANL April 2003 The ANL SIDL compilers are based on the Scientific.
Tammy Dahlgren, Tom Epperly, Scott Kohn, & Gary Kumfert.
Duke CPS From C++ to Java l Java history: Oak, toaster-ovens, internet language, panacea l What it is ä O-O language, not a hybrid (cf. C++)
GT3 Tutorial Chapter 3 and Chapter 4 Lecture for Cluster and Grid Computing, CSCE 490/590 Fall 2004, University of Arkansas, Dr. Amy Apon
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
CCA Common Component Architecture CCA Forum Tutorial Working Group Common Component Architecture.
Gary Kumfert & Scott Kohn Tammy Dahlgren, Tom Epperly, Steve Smith, and Bill Bosl Introducing...
CCA Common Component Architecture CCA Forum Tutorial Working Group Writing Components.
CCA Common Component Architecture CCA Forum Tutorial Working Group A Simple CCA Component Application.
CCA Common Component Architecture CCA Forum Tutorial Working Group Contributors: Introduction to the Ccaffeine Framework.
CCA Common Component Architecture CCA Forum Tutorial Working Group Writing Components.
CCA Common Component Architecture CCA Forum Tutorial Working Group Writing Components.
CCA Distributed Framework Interoperability. Goals Assume you have two (or more) framework instances. –Assume it contains a network of component instances.
CCA Common Component Architecture CCA Forum Tutorial Working Group Common Component Architecture.
CCA Common Component Architecture CCA Forum Tutorial Working Group A Simple CCA Component.
Object Oriented Programming in
CSE775 - Distributed Objects, Spring 2006
Chapter 5 Remote Procedure Call
Introduction to C# AKEEL AHMED.
Java Programming Language
Performance Technology for Parallel Component Software
From C++ to Java Java history: Oak, toaster-ovens, internet language, panacea What it is O-O language, not a hybrid (cf. C++) compiled to byte-code, executed.
Distributed System using Web Services
Common Component Architecture (CCA)
Presentation transcript:

CCA Common Component Architecture CCA Forum Tutorial Working Group Language Interoperable CCA Components via

CCA Common Component Architecture History of Babel & CCA XCAT (Indiana) SciRUN (Utah) CCAFFEINE (SNL) Babel (LLNL) Tutorial Frameworks Language Interoperability Applications Data MxN Decaf Babelized Frameworks CCAFFEINE t

CCA Common Component Architecture What I mean by “Language Interoperability” Simulation Framework (C) Solver Library (C++) Numerical Routines (f77) Scripting Driver (Python) Visualization System (Java) Callback Handlers (Python) Callback Handlers (Python)

CCA Common Component Architecture One reason why mixing languages is hard Native cfortran.h SWIG JNI Siloon Chasm Platform Dependent C C++ f77 f90 Python Java

CCA Common Component Architecture Babel makes all supported languages peers C C++ f77 f90 Python Java Once a library has been “Babelized” it is equally accessable from all supported languages This is not an LCD Solution!

CCA Common Component Architecture Babel Module’s Outline Introduction Babel Basics –What Babel does and how –How to use Babel –Concepts needed for future modules Babel & CCA –Decaf Framework –Building language independent CCA components –Demo

CCA Common Component Architecture Babel’s Mechanism for Mixing Languages Code GeneratorRuntime Library SIDL interface description Babel Compiler C++ F77 F90 Python C XML Matlab? Java Babel Runtime Application

CCA Common Component Architecture greetings.sidl: A Sample SIDL File version greetings 1.0; package greetings { interface Hello { void setName( in string name ); string sayIt ( ); } class English implements-all Hello { } } version greetings 1.0; package greetings { interface Hello { void setName( in string name ); string sayIt ( ); } class English implements-all Hello { } }

CCA Common Component Architecture Library Developer Does This... `babel --server=C++ greetings.sidl` Add implementation details Compile & Link into Library/DLL SIDL interface description Babel Compiler C++ Skels C++ Impls IORs C++ Stubs libgreetings.so

CCA Common Component Architecture Adding the Implementation string greetings::English_impl::sayIt() throw () { // DO-NOT-DELETE splicer.begin(greetings.English.sayIt) string msg(“Hello “); return msg + d_name + “!”; // DO-NOT-DELETE splicer.end(greetings.English.sayIt) } string greetings::English_impl::sayIt() throw () { // DO-NOT-DELETE splicer.begin(greetings.English.sayIt) string msg(“Hello “); return msg + d_name + “!”; // DO-NOT-DELETE splicer.end(greetings.English.sayIt) } namespace greetings { class English_impl { private: // DO-NOT-DELETE splicer.begin(greetings.English._impl) string d_name; // DO-NOT-DELETE splicer.end(greetings.English._impl) namespace greetings { class English_impl { private: // DO-NOT-DELETE splicer.begin(greetings.English._impl) string d_name; // DO-NOT-DELETE splicer.end(greetings.English._impl)

CCA Common Component Architecture Library User Does This... `babel --client=F77 greetings.sidl` Compile & Link generated Code & Runtime Place DLL in suitable location SIDL interface description Babel Compiler IOR Headers F77 Stubs libgreetings.so Babel Runtime Application

CCA Common Component Architecture SIDL 101: Classes & Interfaces SIDL has 3 user-defined objects –Interfaces – APIs only, No Implementation –Abstract Classes – 1+ methods unimplemented –Concrete Classes – All methods are implemented Inheritance (like Java/Objective C) –Interfaces may extend Interfaces –Classes extend no more than one Class –Classes can implement multiple Interfaces Only Concrete Classes can be Instantiated

CCA Common Component Architecture SIDL 101: Methods and Arguments Methods are public virtual by default –static methods are not associated with an object instance –final methods can not be overridden Arguments have 3 parts –Mode: can be in, out, or inout (like CORBA) –Type: one of (bool, char, int, long, float, double, fcomplex, dcomplex, array, enum, interface, class ) –Name:

CCA Common Component Architecture Babel Module’s Outline Introduction Babel Basics –What Babel does and how –How to use Babel –Concepts needed for future modules Babel & CCA –History & Current directions –Decaf Framework –Building language independent CCA components –Demo

CCA Common Component Architecture Decaf Details & Disclaimers Babel is a hardened tool Decaf is an example, not a product –Demonstrate Babel’s readiness for “real” CCA frameworks –Maintained as a stopgap –Distributed in “examples” subdirectory of Babel Decaf has no GUI

CCA Common Component Architecture The CCA Spec is a SIDL File version gov.cca 0.6; package gov { package cca { interface Port { } interface Component { void setServices( in Services svcs ); } interface Services { Port getPort( in string portName ); registerUsesPort( /*etc*/ ); addProvidesPort( /*etc*/ ); /*etc*/ version gov.cca 0.6; package gov { package cca { interface Port { } interface Component { void setServices( in Services svcs ); } interface Services { Port getPort( in string portName ); registerUsesPort( /*etc*/ ); addProvidesPort( /*etc*/ ); /*etc*/

CCA Common Component Architecture The CCA from Babel’s POV

CCA Common Component Architecture How I Implemented Decaf wrote decaf.sidl file `babel --server=C++ cca.sidl decaf.sidl` Add implementation details Compile & Link into Library/DLL cca.sidl & decaf.sidl Babel Compiler C++ Skels C++ Impls IORs C++ Stubs libdecaf.so

CCA Common Component Architecture An Extra Babel Tip “precompile” SIDL into XML store XML in a directory Use Babel’s –R option to specify search directories cca.sidl Babel Compiler XML Type Repository decaf.sidl Babel Compiler Skels Impls IORs Stubs

CCA Common Component Architecture How to Use CCA Components and Decaf Decaf doesn’t provide a GUI Simply program by explicitly –creating components –connecting ports –envoking the “goPort” Use Babel as needed to generate bindings in your language of choice Make sure Babel Runtime can locate DLLs for Decaf and any CCA components.

CCA Common Component Architecture To Use the Decaf Framework `babel --client=Java –Rrepo function.sidl` Compile & Link generated Code & Runtime Place DLLs in suitable location SIDL files Babel Compiler IOR Headers Java Stubs Babel Runtime Application Repo (XML) component1.so libdecaf.so

CCA Common Component Architecture Example: A Driver in Python import decaf.Framework import gov.cca.ports.GoPort if __name__ == ’__main__’: fwk = decaf.Framework.Framework() server = fwk.createInstance( ”ServerName”, ”HelloServer.Component”, 0 ) client = fwk.createInstance( ”ClientName”, ”HelloClient.Component”, 0 ) fwk.connect(server,”HelloPort”, client,”HelloPort” ) port = fwk.lookupPort(client,”GoPort”) go = gov.cca.ports.GoPort.GoPort( port ) go.go() import decaf.Framework import gov.cca.ports.GoPort if __name__ == ’__main__’: fwk = decaf.Framework.Framework() server = fwk.createInstance( ”ServerName”, ”HelloServer.Component”, 0 ) client = fwk.createInstance( ”ClientName”, ”HelloClient.Component”, 0 ) fwk.connect(server,”HelloPort”, client,”HelloPort” ) port = fwk.lookupPort(client,”GoPort”) go = gov.cca.ports.GoPort.GoPort( port ) go.go()

CCA Common Component Architecture How to Write and Use Babelized CCA Components Define “Ports” in SIDL Define “Components” that implement those Ports, again in SIDL Use Babel to generate the glue-code Write the guts of your component(s)

CCA Common Component Architecture How to Write A Babelized CCA Component (1/3) Define “Ports” in SIDL –CCA Port = a SIDL Interface extends gov.cca.Port version tutorial 1.0; package tutorial { interface Function extends gov.cca.Port { double evaluate( in double x ); } version tutorial 1.0; package tutorial { interface Function extends gov.cca.Port { double evaluate( in double x ); }

CCA Common Component Architecture How to Write A Babelized CCA Component (2/3) Define “Components” that implement those Ports –CCA Component = SIDL Class implements gov.cca.Component (& any provided ports) class LinearFunction implements tutorial.Function, gov.cca.Component { double evaluate( in double x ); void setServices( in cca.Services svcs ); } class LinearFunction implements tutorial.Function, gov.cca.Component { double evaluate( in double x ); void setServices( in cca.Services svcs ); } class LinearFunction implements-all tutorial.Function, gov.cca.Component { }

CCA Common Component Architecture How to Write A Babelized CCA Component (3/3) Use Babel to generate the glue code –`babel --server=C –Rrepo function.sidl` Add implementation Details SIDL interface description Babel Compiler C Skels C Impls IORs C Stubs libfunction.so

CCA Common Component Architecture What’s the Hardest Part of this Process? Properly building dynamically loadable.so files. SIDL interface description Babel Compiler C Skels C Impls IORs C Stubs libfunction.so

CCA Common Component Architecture Review of “Linkage” Static Linked Libraries (*.a) –Symbols are hardcoded –Resolved at link-time of application Shared Object Libraries (*.so) –Symbols are hardcoded –Symbols resolved at load time ( before main() ) Dynamically Loaded Libraries (*.so) (*.dll in Win32) –Symbols are determined at run time (by app code) –Symbols resolved at run time ( void* dlopen( char* ) )

CCA Common Component Architecture What goes into a DLL? libfoo.so

CCA Common Component Architecture What goes into a DLL? 1. The Type’s Impl Where all the guts of the component lives. Impl libfoo.so

CCA Common Component Architecture What goes into a DLL? 2. The Type’s IOR IORs (Intermediate Object Representation) Always implemented in ANSI C Babel Object Model is implemented in IOR Dynamic Loading is based on symbols in IOR Impl IOR libfoo.so

CCA Common Component Architecture What goes into a DLL? 3. The Type’s Skel IORs depend on the Skels Skels translate from ANSI C to Impl language Skels call Impls Impl SkelIOR libfoo.so

CCA Common Component Architecture What goes into a DLL? 4. The Type’s Stub Impl depends on Stubs –class needs to call methods on itself –Like “this” pointer in C++ –self in Python Stubs translate from application Language to ANSI C Impl Skel Stub IOR libfoo.so

CCA Common Component Architecture What goes into a DLL? 5. Stubs for all the other types that are passed as arguments, return values, or manipulated internally in the Type’s Impl Impl Skel Stub IOR Stub libfoo.so

CCA Common Component Architecture Q: Why not keep each Stub exclusively with its own Impl? Impl Skel Stub IOR libfoo.so Impl Skel Stub IOR libbar.so A: Works only if bar_Impl and foo_Impl are implemented in the same language

CCA Common Component Architecture IORs provide a language-independent binary interface Impl Skel Stub IOR Stub libfoo.so Impl Skel Stub IOR Stub libbar.so

CCA Common Component Architecture What you’ll see with the upcoming “Hello World” demo Impl Skel Stub IOR Stub CCA Stubs libdecaf.so Impl Skel Stub IOR libserver.so Port Stubs Stub CCA Stubs Impl Skel Stub IOR libclient.so Port Stubs Stub CCA Stubs C++F77C And a “main” in any of python F77 Java

CCA Common Component Architecture Contact Info Project: –Babel: language interoperability tool –Alexandria: component repository –Quorum: web-based parliamentary system –Gauntlet (coming soon): testing framework Bug Tracking: Project Team Mailing Lists: subscribe babel-users [ address] subscribe babel-announce [ address]

CCA Common Component Architecture This work was performed under the auspices of the U.S. Department of Energy by the University of California, Lawrence Livermore National Laboratory under contract No. W-7405-Eng-48 UCRL-PRES , July 2002