Скачать презентацию Performance Technology for Parallel Component Software Sameer Shende Скачать презентацию Performance Technology for Parallel Component Software Sameer Shende

a197c674dea414a2e567555f7b158b05.ppt

  • Количество слайдов: 47

Performance Technology for Parallel Component Software Sameer Shende sameer@cs. uoregon. edu Department of Computer Performance Technology for Parallel Component Software Sameer Shende sameer@cs. uoregon. edu Department of Computer and Information Science Neuro. Informatics Center University of Oregon

Outline What is Component Software? [www. cca-forum. org] r Performance Engineered Component Software r Outline What is Component Software? [www. cca-forum. org] r Performance Engineered Component Software r CCA Performance Observation Component r CCAFFEINE (Classic C++) ¦ SIDL ¦ r Applications : Optimizer Component ¦ Combustion Component ¦ r Concluding remarks Feb. 5, 2003 2 University of Oregon

Why Components? The task of the software development team is to engineer the illusion Why Components? The task of the software development team is to engineer the illusion of simplicity [Booch]. Feb. 5, 2003 3 University of Oregon

The Good the Bad and the Ugly r r An example of what can The Good the Bad and the Ugly r r An example of what can lead to a crisis in software: At least 41 different Fast Fourier Transform (FFT) libraries: ¦ r Many (if not all) have different interfaces ¦ r see, http: //www. fftw. org/benchfft/doc/ffts. html different procedure names and different input and output parameters SUBROUTINE FOUR 1(DATA, NN, ISIGN) ¦ Feb. 5, 2003 Replaces DATA by its discrete Fourier transform (if ISIGN is input as 1) or replaces DATA by NN times its inverse discrete Fourier transform (if ISIGN is input as -1). DATA is a complex array of length NN or, equivalently, a real array of length 2*NN. NN MUST be an integer power of 2 (this is not checked for!). 4 University of Oregon

The Good the Bad and the Ugly r r An example of what can The Good the Bad and the Ugly r r An example of what can lead to a crisis in software: At least 41 different Fast Fourier Transform (FFT) libraries: ¦ r Many (if not all) have different interfaces ¦ r see, http: //www. fftw. org/benchfft/doc/ffts. html different procedure names and different input and output parameters SUBROUTINE FOUR 1(DATA, NN, ISIGN) ¦ Feb. 5, 2003 Replaces DATA by its discrete Fourier transform (if ISIGN is input as 1) or replaces DATA by NN times its inverse discrete Fourier transform (if ISIGN is input as -1). DATA is a complex array of length NN or, equivalently, a real array of length 2*NN. NN MUST be an integer power of 2 (this is not checked for!). 5 University of Oregon

What Are Components [Szyperski] r A component is a binary unit of independent deployment What Are Components [Szyperski] r A component is a binary unit of independent deployment ¦ well separated from other components Ø ¦ r ¦ ¦ is composable (even by physicists) comes with clear specifications of what it requires and provides interacts with its environment through well-defined interfaces A component has no persistent state ¦ ¦ r can be deployed independently A component is a unit of third-party composition ¦ r fences make good neighbors temporary state set only through well-defined interfaces throw away that dependence on global data (common blocks) Similar to Java packages and Fortran 90 modules (with a little help) Feb. 5, 2003 6 University of Oregon

Component Technology r What is a component? ¦ Implementation provides functionality buts hides details Component Technology r What is a component? ¦ Implementation provides functionality buts hides details Ø No ¦ direct access is possible Interface provides access to component functionality Ø Access ¦ “ports” are well-defined and generated by tools Matching connector links component interfaces Ø Constructed Feb. 5, 2003 by framework and hidden from users 7 University of Oregon

Component Technology Features r Interoperability across multiple languages Language independent interfaces (C/C++, Fortran, Java, Component Technology Features r Interoperability across multiple languages Language independent interfaces (C/C++, Fortran, Java, …) ¦ Automatically generated bindings to working code ¦ r Interoperability across multiple platforms Computer systems hardware independence ¦ Operating systems independence ¦ r Transparent execution model ¦ Serial, parallel, and distributed system Incremental evolution of application software r Components promote software reuse r Components are “plug-and-play” r Feb. 5, 2003 8 University of Oregon

Language Interoperability Scripting Driver (Python) Simulation Framework (C) Numerical Routines (f 77) Feb. 5, Language Interoperability Scripting Driver (Python) Simulation Framework (C) Numerical Routines (f 77) Feb. 5, 2003 Visualization System (Java) Solver Library (C++) 9 Callback Handlers (Python) University of Oregon

Mixing Languages is Hard! Native f 77 cfortran. h f 90 C SWIG JNI Mixing Languages is Hard! Native f 77 cfortran. h f 90 C SWIG JNI C++ Python Siloon Chasm Java Feb. 5, 2003 Platform Dependent 10 University of Oregon

Babel makes all supported languages peers f 77 C f 90 C++ This is Babel makes all supported languages peers f 77 C f 90 C++ This is not an LCD Solution! Python Once a library has been “Babelized” it is equally accessable from all supported languages Java Feb. 5, 2003 11 University of Oregon

Babel’s Mechanism for Mixing Languages r Code Generator r Runtime Library XML C Babel Babel’s Mechanism for Mixing Languages r Code Generator r Runtime Library XML C Babel Runtime C++ SIDL interface description F 77 Babel Compiler Python Application Java F 90 Matlab? Feb. 5, 2003 12 University of Oregon

greetings. sidl: A Sample SIDL File version greetings 1. 0; package greetings { interface greetings. sidl: A Sample SIDL File version greetings 1. 0; package greetings { interface Hello { void set. Name( in string name ); string say. It ( ); } class English implements-all Hello { } } Feb. 5, 2003 13 University of Oregon

Library Developer Does This. . . C++ Stubs SIDL interface description IORs Babel Compiler Library Developer Does This. . . C++ Stubs SIDL interface description IORs Babel Compiler C++ Skels libgreetings. so C++ Impls `babel --server=C++ greetings. sidl` r Add implementation details r Compile & Link into Library/DLL r Feb. 5, 2003 14 University of Oregon

Adding the Implementation namespace greetings { class English_impl { private: // DO-NOT-DELETE splicer. begin(greetings. Adding the Implementation 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) string greetings: : English_impl: : say. It() throw () { // DO-NOT-DELETE splicer. begin(greetings. English. say. It) string msg(“Hello “); return msg + d_name + “!”; // DO-NOT-DELETE splicer. end(greetings. English. say. It) } Feb. 5, 2003 15 University of Oregon

Library User Does This. . . Babel Runtime SIDL interface description F 77 Stubs Library User Does This. . . Babel Runtime SIDL interface description F 77 Stubs Babel Compiler IOR Headers Application libgreetings. so `babel --client=F 77 greetings. sidl` r Compile & Link generated Code & Runtime r Place DLL in suitable location r Feb. 5, 2003 16 University of Oregon

Common Component Architecture Specification CCA ports Scientific IDL Framework-specific part of CCA ports Proxy Common Component Architecture Specification CCA ports Scientific IDL Framework-specific part of CCA ports Proxy generator Component 1 Abstract configuration API Component 2 Repository API Repository CCA Services Any CCA compliant framework Builder Feb. 5, 2003 17 University of Oregon

CCA Concepts: Ports Designing for interoperability and reuse requires “standard” interfaces r Ports define CCA Concepts: Ports Designing for interoperability and reuse requires “standard” interfaces r Ports define how components interact r Through well-defined interfaces (ports) ¦ In OO languages, a port is a class or interface ¦ In Fortran, a port is a set of subroutines or a module ¦ r Components may provide ports ¦ r Components may use ports ¦ r Implement the class or subroutines of the port Call methods or subroutines in the port Links denote a caller/callee relationship Feb. 5, 2003 18 University of Oregon

CCA Concepts: Frameworks r Provides the means to “hold” components and compose them into CCA Concepts: Frameworks r Provides the means to “hold” components and compose them into applications r Allow exchange of ports among components without exposing implementation details r Provide a small set of standard services to components ¦ Builder services allow programs to compose CCA apps r Frameworks may make themselves appear as components in order to connect to components in other frameworks r Specific frameworks support specific computing models Feb. 5, 2003 19 University of Oregon

CCA Example Numerically integrate a continuous function r Use two different techniques Function. Port CCA Example Numerically integrate a continuous function r Use two different techniques Function. Port r Lines show port Integrator. Port Function. Port Nonlinear. Function connections r Midpoint. Integrator Go. Port Integrator. Port Driver r Dashed lines are alternate port connections Feb. 5, 2003 Linear. Function a bx Integrator. Port Function. Port Random. Generator. Port Monte. Carlo. Integrator abx 20 Function. Port xn uniformily distributed over [a, b] Pi. Function Random. Generator. Port Random. Generator University of Oregon

CCA Framework Prototypes r CCAFFEINE SPMD/SCMD parallel, direct connect ¦ Direct connection ¦ r CCA Framework Prototypes r CCAFFEINE SPMD/SCMD parallel, direct connect ¦ Direct connection ¦ r CCAT / XCAT Distributed network ¦ Grid Web services ¦ r SCIRun ¦ r Decaf ¦ r Parallel, multithreaded, direct connect Language interoperability via Babel Legion (under development) Feb. 5, 2003 21 University of Oregon

Performance-Engineered Component Software Intra- and Inter-component performance engineering r Four general parts: r ¦ Performance-Engineered Component Software Intra- and Inter-component performance engineering r Four general parts: r ¦ Performance observation Ø integrated ¦ Performance query and monitoring Ø runtime ¦ measurement and analysis access to performance information Performance control Ø mechanisms ¦ to alter performance observation Performance knowledge Ø characterization r and modeling Consistent with component architecture / implementation Feb. 5, 2003 22 University of Oregon

Main Idea: Extend Component Design repository service ports performance knowledge ports component ports performance Main Idea: Extend Component Design repository service ports performance knowledge ports component ports performance observation ports … … … Performance Knowledge Component Core Performance Observation … Component Performance Repository r variants measurement analysis empirical analytical Extend the programming and execution environment to be performance observable and performance aware Feb. 5, 2003 23 University of Oregon

Performance Observation and Component Performance measurement integration in component form r Functional extension of Performance Observation and Component Performance measurement integration in component form r Functional extension of original component design ( ) r component ports performance observation ports … … Component Core … Performance Observation Include new component variants methods and ports ( ) for other measurement analysis components to access measured performance data ¦ Allow original component to access performance data ¦ Ø Encapsulate Feb. 5, 2003 as tightly-coupled and co-resident performance observation object Ø POC “provides” port allow use of optimized interfaces ( ) to access ``internal'' performance observations 24 University of Oregon

Performance Knowledge r Describe and store “known” component performance Benchmark characterizations in performance database Performance Knowledge r Describe and store “known” component performance Benchmark characterizations in performance database ¦ Empirical or analytical performance models ¦ r Saved information about component performance Use for performance-guided selection and deployment ¦ Use for runtime adaptation ¦ r Representation must be in common forms with standard means for accessing the performance information ¦ Feb. 5, 2003 Compatible with component architecture 25 University of Oregon

Component Performance Repository r Performance knowledge storage Implement in component architecture framework ¦ Similar Component Performance Repository r Performance knowledge storage Implement in component architecture framework ¦ Similar to CCA component repository ¦ Access by component infrastructure ¦ r repository service ports performance knowledge ports … Performance Knowledge Component Performance Repository empirical analytical View performance knowledge as component (PKC) PKC ports give access to performance knowledge ¦ to other components, back to original component ¦ Static/dynamic component control and composition ¦ Component composition performance knowledge ¦ Feb. 5, 2003 26 University of Oregon

Performance Engineering Support in CCA r Define a standard observation component interface for: Performance Performance Engineering Support in CCA r Define a standard observation component interface for: Performance measurement ¦ Performance data query ¦ Performance control (enable/disable) ¦ r Implement performance interfaces for use in CCA TAU performance system ¦ CCA component frameworks (CCAFFEINE, SIDL/Babel) ¦ r Demonstrations ¦ Optimizing component Ø picks ¦ Feb. 5, 2003 from a set of equivalent CCA port implementations Flame reaction-diffusion application 27 University of Oregon

CCA Performance Observation Component r Design measurement port and measurement interfaces ¦ Timer Ø CCA Performance Observation Component r Design measurement port and measurement interfaces ¦ Timer Ø start/stop Ø set ¦ name/type/group Control Ø enable/disable ¦ groups Query Ø get timer names Ø metrics, counters, dump to disk ¦ Event Ø user-defined Feb. 5, 2003 events 28 University of Oregon

CCA C++ (CCAFFEINE) Performance Interface namespace performance { Measurement port namespace ccaports { class CCA C++ (CCAFFEINE) Performance Interface namespace performance { Measurement port namespace ccaports { class Measurement: public virtual classic: : gov: : cca: : Port { public: virtual ~ Measurement (){} /* Create a Timer interface virtual performance: : Timer* string group) = 0; */ create. Timer(void) = 0; create. Timer(string name, string type) = 0; create. Timer(string name, string type, Measurement interfaces /* Create a Query interface */ virtual performance: : Query* create. Query(void) = 0; /* Create a user-defined Event interface */ virtual performance: : Event* create. Event(void) = 0; virtual performance: : Event* create. Event(string name) = 0; /* Create a Control interface for selectively enabling and disabling * the instrumentation based on groups */ virtual performance: : Control* create. Control(void) = 0; }; } } Feb. 5, 2003 29 University of Oregon

CCA Timer Interface Declaration namespace performance { class Timer { public: virtual ~Timer() {} CCA Timer Interface Declaration namespace performance { class Timer { public: virtual ~Timer() {} /* Implement methods in a derived class to provide functionality */ /* Start and stop the Timer */ virtual void start(void) = 0; virtual void stop(void) = 0; Timer interface methods /* Set name and type for Timer */ virtual void set. Name(string name) = 0; virtual string get. Name(void) = 0; virtual void set. Type(string name) = 0; virtual string get. Type(void) = 0; /* Set the group name and group type associated with the Timer */ virtual void set. Group. Name(string name) = 0; virtual string get. Group. Name(void) = 0; virtual void set. Group. Id(unsigned long group ) = 0; virtual unsigned long get. Group. Id(void) = 0; }; } Feb. 5, 2003 30 University of Oregon

Use of Observation Component in CCA Example #include Use of Observation Component in CCA Example #include "ports/Measurement_CCA. h". . . double Monte. Carlo. Integrator: : integrate(double low. Bound, double up. Bound, int count) { classic: : gov: : cca: : Port * port; double sum = 0. 0; // Get Measurement port = framework. Services->get. Port ("Measurement. Port"); if (port) measurement_m = dynamic_cast < performance: : ccaports: : Measurement * >(port); if (measurement_m == 0){ cerr << "Connected to something other than a Measurement port"; return -1; } static performance: : Timer* t = measurement_m->create. Timer( string("Integrate. Timer")); t->start(); for (int i = 0; i < count; i++) { double x = random_m->get. Random. Number (); sum = sum + function_m->evaluate (x); } t->stop(); } Feb. 5, 2003 31 University of Oregon

Using TAU Component in CCAFEINE repository repository create create get get Tau. Timer Driver Using TAU Component in CCAFEINE repository repository create create get get Tau. Timer Driver Midpoint. Integrator Monte. Carlo. Integrator Random. Generator Linear. Function Nonlinear. Function Pi. Function Linear. Function lin_func Nonlinear. Function nonlin_func Pi. Function pi_func Monte. Carlo. Integrator mc_integrator Random. Generator rand create Tau. Timer tau connect mc_integrator Random. Generator. Port rand Random. Generator. Port connect mc_integrator Function. Port nonlin_func Function. Port connect mc_integrator Timer. Port tau Timer. Port create Driver driver connect driver Integrator. Port mc_integrator Integrator. Port go driver Go quit Feb. 5, 2003 32 University of Oregon

SIDL Interface for Performance Component version performance 1. 0; package performance { interface Timer SIDL Interface for Performance Component version performance 1. 0; package performance { interface Timer { /* Start/stop the Timer */ void start(); void stop(); /* Set/get the Timer name */ void set. Name(in string name); string get. Name(); /* Set/get Timer type information (e. g. , signature of the routine) */ void set. Type(in string name); string get. Type(); /* Set/get the group name associated with the Timer */ void set. Group. Name(in string name); string get. Group. Name(); /* Set/get the group id associated with the Timer */ void set. Group. Id(in long group); long get. Group. Id(); } … Feb. 5, 2003 33 University of Oregon

SIDL Interface : Control interface Control { /* Enable/disable group id */ void enable. SIDL Interface : Control interface Control { /* Enable/disable group id */ void enable. Group. Id(in long id); void disable. Group. Id(in long id); /* Enable/disable group name */ void enable. Group. Name(in string name); void disable. Group. Name(in string name); /* Enable/disable all groups */ void enable. All. Groups(); void disable. All. Groups(); } /* Implementation of performance component Control interface*/ class Tau. Control implements-all Control { } /* Implementation of performance component Measurement interface*/ class Tau. Measurement implements-all Measurement, gov. cca. Component { } Feb. 5, 2003 34 University of Oregon

SIDL Interface : Query /* Query interface to obtain timing information */ interface Query SIDL Interface : Query /* Query interface to obtain timing information */ interface Query { /* Get the list of Timer and Counter names */ array get. Timer. Names(); array get. Counter. Names(); void get. Timer. Data(in array timer. List, out array counter. Exclusive, out array counter. Inclusive, out array num. Calls, out array num. Child. Calls, out array counter. Names, out int num. Counters); /* Writes instantaneous profile to disk in a dump file. */ void dump. Profile. Data(); /* Writes the instantaneous profile to disk in a dump file whose name * contains the current timestamp. */ void dump. Profile. Data. Incremental(); /* Writes the list of timer names to a dump file on the disk */ void dump. Timer. Names(); /* Writes the profile of the given set of timers to the disk. */ void dump. Timer. Data(in array timer. List); /* Writes the profile of the given set of timers to the disk. The dump * file name contains the current timestamp when the data was dumped. */ void dump. Timer. Data. Incremental(in array timer. List); } Feb. 5, 2003 35 University of Oregon

SIDL Interface : Event /* User defined event profiles for application specific events */ SIDL Interface : Event /* User defined event profiles for application specific events */ interface Event { /* Set the name of the event */ void set. Name(in string name); /* Trigger the event */ void trigger(in double data); } Feb. 5, 2003 36 University of Oregon

Measurement Port Implementation r Use of Measurement port (i. e. , instrumentation) independent of Measurement Port Implementation r Use of Measurement port (i. e. , instrumentation) independent of choice of measurement tool ¦ independent of choice of measurement type ¦ r TAU performance observability component Implements the Measurement port ¦ Implements Timer, Control, Query, Control ¦ ¦ r Port can be registered with the CCAFEINE framework Components instrument to generic Measurement port Runtime selection of TAU component during execution ¦ Tau. Measurement_CCA port implementation uses a specific TAU library for choice of measurement type ¦ Feb. 5, 2003 37 University of Oregon

What’s Going On Here? application component Two instrumentation paths using TAU API application component What’s Going On Here? application component Two instrumentation paths using TAU API application component performance component … TAU API Two query and control paths using TAU API Feb. 5, 2003 TAU API runtime TAU performance data 38 other API Alternative implementations of performance component University of Oregon

Simple Runtime Performance Optimization r Components are “plug-and-play” One can choose from a set Simple Runtime Performance Optimization r Components are “plug-and-play” One can choose from a set of equivalent port implementations based on performance measurements ¦ An outside agent can monitor and select an optimal working set of components ¦ Function. Port Integrator. Port Function. Port Midpoint. Integrator Go. Port Integrator. Port Nonlinear. Function. Port Linear. Function. Port Driver Integrator. Port Function. Port Random. Generator. Port Monte. Carlo. Integrator Pi. Function Random. Generator. Port Random. Generator Feb. 5, 2003 39 University of Oregon

Component Optimizing Performance Results Feb. 5, 2003 40 University of Oregon Component Optimizing Performance Results Feb. 5, 2003 40 University of Oregon

Computational Facility for Reacting Flow Science r Sandia National Laboratory DOE Sci. DAC project Computational Facility for Reacting Flow Science r Sandia National Laboratory DOE Sci. DAC project (http: //cfrfs. ca. sandia. gov) ¦ Jaideep Ray ¦ r Component-based simulation and analysis Sandia’s CCAFFEINE framework ¦ Toolkit components for assembling flame simulation ¦ Ø integrator, spatial discretizations, chemical/transport models Ø structured adaptive mesh, load-balancers, error-estimators Ø in-core, off-machine, data transfers for post-processing ¦ r Components are C++ and wrapped F 77 and C code Kernel for 3 D, adaptive mesh low Mach flame simulation Feb. 5, 2003 41 University of Oregon

Flame Reaction-Diffusion Demonstration CCAFFEINE Feb. 5, 2003 42 University of Oregon Flame Reaction-Diffusion Demonstration CCAFFEINE Feb. 5, 2003 42 University of Oregon

Meeting CCA Performance Engineering Goals? r Language interoperability? SIDL and Babel give access to Meeting CCA Performance Engineering Goals? r Language interoperability? SIDL and Babel give access to all supported languages ¦ TAU supports multi-language instrumentation ¦ Component interface instrumentation automated with PDT ¦ r Platform interoperability? Implement observability component across platforms ¦ TAU runs wherever CCA runs ¦ r Execution model transparent? ¦ r TAU measurement support for multiple execution models Reuse with any CCA-compliant framework? ¦ Feb. 5, 2003 Demonstrated with SIDL/Babel, CCAFEINE, SCIRun 43 University of Oregon

Importance to Grid Computing and Performance r Component software is a natural model for Importance to Grid Computing and Performance r Component software is a natural model for developing applications for the Grid ¦ r ICENI (Imperial College), CCAT / XCAT (U. Indiana) Our work leverages abstraction power of CCA as well as the infrastructure of CCA frameworks Similarly leverage Grid infrastructure and services ¦ Mostly riding back of CCA framework development ¦ r Application-level performance view coupled with Grid resource assessment and monitoring More responsive to performance dynamics ¦ Beginning work with NWS forecaster in applications ¦ Feb. 5, 2003 44 University of Oregon

Meeting CCA Performance Engineering Goals? r Component performance knowledge? Representation and performance repository work Meeting CCA Performance Engineering Goals? r Component performance knowledge? Representation and performance repository work to do ¦ Utilize effectively for deployment and steering ¦ Build repository with TAU performance database ¦ r Performance of component compositions? ¦ Component-to-component performance Ø Per connection instrumentation and measurement Ø Utilize performance mapping support ¦ Ensemble-wide performance monitoring Ø connect performance “producers” to “consumers” Ø component-style implementation Feb. 5, 2003 45 University of Oregon

Concluding Remarks Parallel component systems pose challenging performance analysis problems that require robust methodologies Concluding Remarks Parallel component systems pose challenging performance analysis problems that require robust methodologies and tools r New performance problems will arise r Instrumentation and measurement ¦ Data analysis and presentation ¦ Diagnosis and tuning ¦ Performance modeling ¦ r Performance engineered components ¦ r Performance knowledge, observation, query and control Available from: http: //www. cs. uoregon. edu/research/paracomp/tauprofile/dist/taucomponent. tar. gz Feb. 5, 2003 46 University of Oregon

Support Acknowledgement r TAU and PDT support: ¦ Department of Energy (DOE) Ø DOE Support Acknowledgement r TAU and PDT support: ¦ Department of Energy (DOE) Ø DOE 2000 ACTS contract Ø DOE MICS contract Ø DOE ASCI Level 3 (LANL, LLNL) Ø U. of Utah DOE ASCI Level 1 subcontract ¦ ¦ DARPA NSF National Young Investigator (NYI) award