Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Prograamção Paralela Baseada em Componentes (Introduzido o Modelo #)


Published on

CMSPI 2007 - Porto de Galinhas/Recife-PE

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Prograamção Paralela Baseada em Componentes (Introduzido o Modelo #)

  1. 1. Parallel Programming with Components Prof. Dr. Francisco Heron de Carvalho Junior ( Mestrado e Doutorado em Ciência da Computação Departamento de Computação Universidade Federal do Ceará
  2. 2. Presentation Plan <ul><li>What are components ? </li></ul><ul><li>Components in high performance computing </li></ul><ul><li>Parallelism support in components infrastructures </li></ul><ul><li>The # component model and # programming systems </li></ul><ul><li>Conclusions </li></ul>
  3. 3. Software Components <ul><li>What is a software component ? </li></ul><ul><ul><li>“ A software components is a unit of composition with contractually specified interfaces and explicit context dependencies only. A software components can be deployed independently and is subject to composition by third parties” (workshop on Component-Oriented Programming at ECOOP 1996) . </li></ul></ul>
  4. 4. Component Technology <ul><li>A component infrastructure is defined by </li></ul><ul><ul><li>a component model </li></ul></ul><ul><ul><ul><li>What are the components, concretely, and how they are created; </li></ul></ul></ul><ul><ul><li>A connection model </li></ul></ul><ul><ul><ul><li>What kind of connectors are supported for composing components in a high-level component or an application; </li></ul></ul></ul><ul><ul><li>a deployment model </li></ul></ul><ul><ul><ul><li>How a component is mapped to an execution platform (architecture), how it is launched with an application, and how it coexists with other components in an environment, and so on. </li></ul></ul></ul>
  5. 5. Component Technology <ul><li>Components Infrastructures: </li></ul><ul><ul><li>Java Beans / EJB; </li></ul></ul><ul><ul><li>COM / DCOM; </li></ul></ul><ul><ul><li>CORBA; </li></ul></ul><ul><ul><li>.NET; </li></ul></ul><ul><ul><li>OSGi ( Open Services Gateway Initiative ) </li></ul></ul><ul><ul><li>Web Services ; </li></ul></ul><ul><li>Commercial applications; </li></ul><ul><li>Service interfaces (method signatures); </li></ul><ul><li>A very natural paradigm for distributed computing; </li></ul><ul><ul><li>Remote method calls (client-server relationships); </li></ul></ul><ul><li>Parallelism support is not explicit; </li></ul><ul><li>High overhead for using in HPC (lots of indirections !) . </li></ul>
  6. 6. Components and HPC <ul><li>Component models and frameworks have been developed for the specific needs of HPC applications; </li></ul><ul><li>CCA ( Common Component Architecture ) </li></ul><ul><ul><li>Inspiration in commercial component models (CORBA/COM); </li></ul></ul><ul><ul><li>SIDL (Scientific Interface Definition Language); </li></ul></ul><ul><ul><li>Client/server interfaces with method signatures; </li></ul></ul><ul><ul><ul><li>Uses/Provides design pattern; </li></ul></ul></ul><ul><ul><li>Direct method calls whenever possible; </li></ul></ul><ul><li>Fractal </li></ul><ul><ul><li>Hierarchical composition (primitive vs composite components); </li></ul></ul><ul><ul><li>Comunicação assíncrona ( futures ); </li></ul></ul><ul><ul><li>ASP calculus (semantics); </li></ul></ul><ul><ul><li>Reflective facilities through controllers; </li></ul></ul><ul><ul><li>ADL for describing configurations; </li></ul></ul><ul><ul><li>Fractal has been used as the basis for GCM (Grid Component Model); </li></ul></ul>ProActive Julia CCAffeine XCAT MOCCA SciRun2 LegionCCA DCA
  7. 7. Parallelism and Components <ul><li>What is a parallel program (distributed case) ? </li></ul><ul><ul><li>A set of programs interacting through some synchronization mechanism to solve a problem that could be solved by a sequential program; </li></ul></ul><ul><ul><li>Why ? To minimize “time to solution”; </li></ul></ul><ul><ul><li>How ? Exploiting concurrency inherent to the problem and/or solution algorithms; </li></ul></ul><ul><ul><li>Synchronization mechanism(s) must support Peer-to-Peer and Client-Server relations; </li></ul></ul><ul><ul><ul><li>message-passing or channel-based synchronization; </li></ul></ul></ul>MPMD SPMD
  8. 8. Parallelism and Components <ul><li>Parallelism encapsulated inside components; </li></ul><ul><ul><li>Parallelism in CORBA (PARDIS, PaCo++, GridCCM, Data Parallel Corba); </li></ul></ul><ul><li>Data parallelism between a set of cooperating components; </li></ul><ul><li>SCMD ( Single Component, Multiple Data ) </li></ul><ul><ul><li>a cohort of components perform the same task over each part of a data structure; </li></ul></ul><ul><ul><li>Components interact using any synchronization mechanism; </li></ul></ul><ul><ul><li>CCA “ stays out of the way with components parallelism” ; </li></ul></ul><ul><ul><li>CCA community now looks for MCMD extensions; </li></ul></ul><ul><li>Extensions to client-server connectors </li></ul><ul><ul><li>Supporting several clients and several several; </li></ul></ul><ul><ul><li>Distinguished cases: 1  M, N  1, M  N; </li></ul></ul><ul><ul><li>Fractal/ProActive: multicast / gathercast interfaces; </li></ul></ul><ul><ul><li>Is this sufficient expressive compared to MPI ? </li></ul></ul>
  9. 9. Parallelism and Components <ul><li>The “weakness” of current component models for parallelism: </li></ul><ul><ul><li>Parallelism concerns orthogonal to the component and connection models; </li></ul></ul><ul><ul><li>Support for a fixed (normally unitary) set of connectors, emphasizing client/server relations; </li></ul></ul><ul><ul><ul><li>Useful for commercial applications (distributed systems); </li></ul></ul></ul><ul><ul><ul><li>CCA and Fractal follow this approach; </li></ul></ul></ul><ul><ul><ul><ul><li>“ (...) stay of the way with component parallelism (...)” </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Further works looks for more expressive forms of parallelism (???) </li></ul></ul></ul></ul><ul><ul><li>If not purely SCMD, common modularization principles are broken ! </li></ul></ul><ul><ul><ul><li>For example: parallel concerns scattered accross a set of components; </li></ul></ul></ul>Parallel programs involve a dynamically evolving set of connectors, most of them emphasizing peer-to-peer relations ;
  10. 10. Parallelism and Components <ul><li>Trends in software architecture </li></ul><ul><ul><li>Focus on connectors; </li></ul></ul><ul><ul><li>Exogenous coordination; </li></ul></ul><ul><ul><li>Composing new connectors by combination of existing ones; </li></ul></ul><ul><ul><ul><li>Algebras of connectors: Reo, CommUnity, ... </li></ul></ul></ul><ul><li>A model of parallel components needs to support ... </li></ul><ul><ul><li>... The ability to encapsulate parallel concerns. </li></ul></ul><ul><ul><li>... several primitive connectors for parallel synchronization; </li></ul></ul><ul><ul><li>... user-defined (programmable) connectors; </li></ul></ul><ul><ul><li>... tuning implementation of connectors and components for architectures; </li></ul></ul><ul><li>Kinds of connectors appropriate for specific architectures; </li></ul><ul><ul><li>Different Memory and parallelism hierarchies ??? </li></ul></ul>A component defined by its relations with other components in the environment
  11. 11. The # Component Model <ul><li>A notion of parallel component called #-component; </li></ul><ul><li>A #-component is like an usual component deployed in a set of computing nodes of a parallel architecture </li></ul><ul><li>A #-component address a (parallel) concern; </li></ul><ul><ul><li>Given a parallel program P, composed by N processes, that uses a #-component C in its composition, each unit u i , 1 < i  N, denote the role of a process of P with respect to a given concern ; </li></ul></ul><ul><ul><li>Bottom-up perspective: we say that units are slices of processes after slicing the parallel program by using the concern addressed by the #-component as a slicing criterion ; </li></ul></ul>... units #-component
  12. 12. P 1 P 2 P 3 P 4 The model abstracts away from a concrete notion of role <ul><li>Send a message to another process; </li></ul><ul><li>Receive a message from another process; </li></ul><ul><li>Calculate the contribution of a process in the parallel solution of a linear system </li></ul><ul><li>Informs the processor where the process will execute, </li></ul><ul><li>Informs the processor about execution time parameteres; </li></ul><ul><li>A CCA uses port; </li></ul><ul><li>A CCA provides port; </li></ul><ul><li>etc </li></ul>#-components may be used to address non-functiona concerns !!! u 1 u 2 v 1 v 2 v 3 v 4 t 1 t 2 t 3
  13. 13. The # Component Model <ul><li>#-components may be composed by overlapping composition </li></ul>... joining ... ... ... ... ... ... ...
  14. 14. The # Component Model <ul><li>#-components may be composed by overlapping composition </li></ul>... ... ... unification ... ... ... ... ... ... ...
  15. 15. The # Component Model <ul><li>#-components may be composed by overlapping composition </li></ul>fusion ... ... ... ... ... ... ... ... ...
  16. 16. The # Compoent Model <ul><li>Exogenous coordination: </li></ul>a b c d e f g h par { seq {a; b; c}; alt {d; seq {e; f}; seq {g; h} } } protocol OpenMP directives #omp paralell sections { a(); b(); c(); } #omp section { if (<condition>) { d(); } else if (<condition>) { e(); f(); } else { g(); h(); } } Petri net
  17. 18. Example of steps in the overlapping composition of three components
  18. 19. Component Kinds <ul><li>What defines a # Programming System ??? </li></ul><ul><ul><li>A programming platform that materializes a notion of #-component in terms of common software abstractions ; </li></ul></ul><ul><ul><li>It defines a set of component kinds ; </li></ul></ul><ul><li>A component kind includes a set of #-components that </li></ul><ul><ul><li>are concretely described in terms of the same software abstractions; </li></ul></ul><ul><ul><li>have the same restrictions for overlapping composition of other #-components according to their respective component kinds ; </li></ul></ul><ul><ul><li>have the same deployment models in a platform; </li></ul></ul><ul><li>Connectors may be treated as kinds of #-components; </li></ul>
  19. 20. Component Kinds <ul><li>The set of Fractal components might form a component kind in a # programming system; </li></ul><ul><li>The sets of CCA components , ports , and bindings each one might form a component kind in a # programming system; </li></ul><ul><li>The set of connectors for collective communication might form a component kind in a # programming system; </li></ul><ul><li>The subroutines of a linear algebra parallel library, such as PETSc and ScaLAPACK could be thought in terms of component kinds; </li></ul><ul><li>(...) </li></ul>Could an extensible # programming system be used to integrate different component infrastructures and frameworks , also including parallel synchronization connectors that are not found in most of them ? topic to investigate:
  20. 21. Front-End Core Back-End discovery configuration registration retrieving deployment running monitoring HASH FRAMEWORK ARCHITECTURE Developers Components Core Back-End Front-End Execution Platforms
  21. 22. Locations Core Front-End Back-End
  22. 23. Locations Core Front-End Back-End
  23. 24. HPE (The Hash Programming Environment) <ul><li>It is a general purpose parallel programming platform </li></ul><ul><ul><li>... not a computational science framework ! </li></ul></ul><ul><ul><li>... not a problem solving environment ! </li></ul></ul><ul><li>It is a # programming system </li></ul><ul><ul><li>Materialization of a notion of #-component by specifying a set of component kinds appropriate to the application domain; </li></ul></ul><ul><li>It complies to the Hash Framework Architecture; </li></ul><ul><ul><li>Front-End : Visual Configuratin Editor on the Eclipse Platform (GEF/EMF); </li></ul></ul><ul><ul><li>Core : a Web-Service that acess a set of registered locations </li></ul></ul><ul><ul><ul><li>Locations are also Web Services. </li></ul></ul></ul><ul><ul><li>Back-End : </li></ul></ul><ul><ul><ul><li>Clusters of multi-processors; </li></ul></ul></ul><ul><ul><ul><li>Extension of Mono/CLI (next slide); </li></ul></ul></ul><ul><ul><ul><li>Forró ( probably the first, and still unique, Brazilian CCA framework ) for distributed parallel computations (workspaces, linked bindings, iterators, etc). </li></ul></ul></ul>
  24. 25. HPE (The Hash Programming Environment) #-components Architectures Environments Computations Data Structures Synchronizers Applications Qualifiers
  25. 26. The Back-End of HPE <ul><li>Extending the Mono/CLI platform; </li></ul><ul><li>Why Mono/CLI ? </li></ul><ul><ul><li>Language interoperability through a common type system; </li></ul></ul><ul><ul><li>Support for native arrays; </li></ul></ul><ul><ul><li>Improvements in just-in-time compilation (virtual machines performance); </li></ul></ul><ul><ul><li>Support for unmanaged code; </li></ul></ul><ul><ul><li>Side-by-side control of component versions; </li></ul></ul><ul><li>DGAC (Distributed GAC) </li></ul><ul><ul><li>GAC = Global Assembly Cache ; </li></ul></ul><ul><ul><li>Manage deployment of #-components; </li></ul></ul><ul><li>The definition of a #-component dependes on its component kind ; </li></ul><ul><ul><li>Computation and Synchronization : units are classes implementing the methods activate and synchronize , respectively; </li></ul></ul><ul><ul><li>Data Structure : units are simple objects or abstract data types; </li></ul></ul><ul><ul><li>Application : units are static classes implementing the method main. They instantiate all slices of the process that they implement; </li></ul></ul><ul><ul><li>Architecture , Environment , and Qualifiers : XML configuration files; </li></ul></ul><ul><ul><ul><li>Non-functional information </li></ul></ul></ul>
  26. 27. The Back-End of HPE <ul><li>Back-End </li></ul>... cluster Node 1 Node 2 Node 3 Node N NETWORK Mono Mono Mono Mono Hash-Mono Hash-Mono Hash-Mono Hash-Mono Mono API Mono API Mono API Mono API Distributed Hash-Mono
  27. 28. Abstract Components <ul><li>From the Front-End , programmers may build </li></ul><ul><ul><li>abstract components specifications, and </li></ul></ul><ul><ul><li>concrete components implementations that conform to a given abstract component; </li></ul></ul><ul><li>A concrete component is an implementation of an abstract component that is optimized to a specific execution platform; </li></ul><ul><li>A concrete component is directly deployed in the architecture; </li></ul><ul><ul><li>The system knows the abstract component of each concrete component; </li></ul></ul><ul><ul><ul><li>Registered in the DGAC; </li></ul></ul></ul><ul><ul><li>Only one concrete component may be deployed for each abstract component; </li></ul></ul><ul><ul><li>Several versions of a concrete component may exist in the environment; </li></ul></ul><ul><ul><ul><li>GAC/Mono support; </li></ul></ul></ul><ul><li>When an abstract component C built from inner abstract components B 1 , B 2 , ..., B n is deployed, the system will look for deployed #-components b 1 , b 2 , ... b n and compose them to form C using the configuration specification. </li></ul><ul><ul><li>Deployment procedure. </li></ul></ul>
  28. 29. Domain Specific # Programming Systems using the Hash Architecture or HPE Framework <ul><li>Define appropriate component kinds for the application domain ; </li></ul><ul><ul><li>What abstractions scientists and engineers need to compose applications of their interest ??? </li></ul></ul><ul><ul><li>Computational Science Frameworks and Problem Solving Environments ; </li></ul></ul><ul><li>Forró : Components, Ports, Workspaces, Locations, Bindings, and Links ! </li></ul><ul><ul><li>Support for distributed paralel computations in HPE; </li></ul></ul><ul><ul><li>Parallel progams running in distinct clusters accessed through the same Back-End; </li></ul></ul><ul><ul><li>Investigate interoperability between CCA frameworks ??? </li></ul></ul><ul><ul><ul><li>A component with bindings in different CCA frameworks encapsulated by disjoint workspaces ; </li></ul></ul></ul><ul><li>MPhyScas : Kernels, Groups, Blocks, Phenomena, Quantities, States ? </li></ul><ul><ul><li>Front-End for building simulations ? </li></ul></ul><ul><ul><li>Abstract components for supporting implementations for different archictetural characteristics ? </li></ul></ul><ul><li>Application to build Problem Solving Environments ?? </li></ul><ul><ul><li>Towards the higher level of abstraction for scientists and engineers .... </li></ul></ul>
  29. 30. Conclusions <ul><li>Parallelism support in component models and frameworks is still an evolving area of research; </li></ul><ul><li>We think that focusing on appropriate connectors it is possible to address paralelism in component models; </li></ul><ul><ul><li>See our CompFrame’2007 paper for examples of useful connectors and its use with abstract components; </li></ul></ul><ul><li>We have presented how we have tried to apply our ideas: </li></ul><ul><ul><li>The # Component Model; </li></ul></ul><ul><ul><li>The Hash Architecture; </li></ul></ul><ul><ul><li>The Hash Programming Environment; </li></ul></ul><ul><ul><li>Integration to the Forró CCA Framework; </li></ul></ul>
  30. 31. Parallel Programming with Components Prof. Dr. Francisco Heron de Carvalho Junior ( Mestrado e Doutorado em Ciência da Computação Departamento de Computação Universidade Federal do Ceará