Presentation is loading. Please wait.

Presentation is loading. Please wait.

Interface Contract Enforcement for Improvement of Computational Quality of Services (CQoS) for Scientific Components Li Li 1, Tamara L. Dahlgren 2, Lois.

Similar presentations


Presentation on theme: "Interface Contract Enforcement for Improvement of Computational Quality of Services (CQoS) for Scientific Components Li Li 1, Tamara L. Dahlgren 2, Lois."— Presentation transcript:

1 Interface Contract Enforcement for Improvement of Computational Quality of Services (CQoS) for Scientific Components Li Li 1, Tamara L. Dahlgren 2, Lois Curfman McInnes 1, and Boyana Norris 1 1 Argonne National Laboratory, Argonne, IL. 2 Lawerence Livermore National Laboratory, CA. CCA meeting Jan. 2010

2 22 Outline Introduction to CQoS and Interface Contracts Contract Enforcement in CQoS Application Use Cases Ongoing and Future Work

3 3 Computational Quality of Service (CQoS) Complex Multidisciplinary Applications –Common component interfaces + programming language interoperability + dynamic composability easy access to suites of independently developed algorithms and implementations –No single research group can select or tune all components of a given application Capitalize on the CCA* component approach –Support interoperability of different implementations –Facilitate component replacement, recomposition, etc. Automate the configuration and runtime adaptation of high- performance component applications –Instrumentation of component interfaces –Performance data gathering and analysis –Adaptive algorithm support 3

4 44 Motivating Examples Simulation times for nonlinear PDE-based models depend on the robustness and efficiency of sparse linear solvers –Attributes of the coefficient matrix of linear system change with time –How to select linear solver and reconfigure the solver component Quantum Chemistry challenges: –How do we adapt to resource changes at runtime and select the most appropriate solver among interoperable QC components and reconfigure algorithmic parameters? QC components from QCSAP http://www.scidac.gov/matchem/better.html FACETS fusion

5 5 Computational Quality of Service(CQoS) Infrastructure Develop general-purpose tools; build application-specific capabilities on top of these Analysis Infrastructure Performance monitoring, problem/solution characterization, performance model building Performance Databases (historical & runtime) Performance Databases (historical & runtime) Interactive Analysis and Model Building Substitution Assertion Database Substitution Assertion Database Scientist can analyze data interactively Scientist can provide decisions on substitution and reparameterization Instrumented Component Application Cases Instrumented Component Application Cases Control Infrastructure Interpretation and execution of control laws to modify an application’s behavior Control System (parameter changes and component substitution) Control System (parameter changes and component substitution) CQoS-Enabled Component Application CQoS-Enabled Component Application Component A Component B Component C Component Substitution Set Enforce contract

6 6 Interface Contracts: Runtime Checkable Annotations in SIDL* Specifications Ensure the following (with respect to the specification) at runtime: Components written correctly Programs use components correctly The proper component is used (at the right time) Aid runtime adaptation, especially for long-running applications double dot (in array u, in array v, in double tol) throws sidl.PreViolation, sidl.PostViolation; require/* Preconditions */ u_is_1d: (u != null) implies (dimen(u) == 1;) v_is_1d: (v != null) implies (dimen(v) == 1;) same_size: size(u) == size(v); non_negative_tolerance: tol >= 0.0; ensure/* Postconditions */ areEqual(u, v, tol) implies (result >= 0.0); (isZero(u, tol) and isZero(v, tol)) implies nearEqual(result, 0.0, tol); double dot (in array u, in array v, in double tol) throws sidl.PreViolation, sidl.PostViolation; require/* Preconditions */ u_is_1d: (u != null) implies (dimen(u) == 1;) v_is_1d: (v != null) implies (dimen(v) == 1;) same_size: size(u) == size(v); non_negative_tolerance: tol >= 0.0; ensure/* Postconditions */ areEqual(u, v, tol) implies (result >= 0.0); (isZero(u, tol) and isZero(v, tol)) implies nearEqual(result, 0.0, tol); Preconditions are obligations on component callers Postconditions are obligations on component implementations *SIDL = Scientific Interface Definition Language

7 77 Outline Introduction to CQoS and Interface Contracts Contract Enforcement in CQoS Application Use Cases Ongoing and Future Work

8 8 Contract Structured Solver Contract Nonlinear Solver Contract Linear Solver Components with Interface Contracts CQoS Infrastructure Analysis Component Performance & Metadata Database Component Database Component Store/Query component performance & metadata Extract component parameter tuning info. Query data/store results A Contract-Enhanced CQoS Component App. CQoS-Enabled Component Application

9 99 CQoS Interface Contract Types Argument validator –Ensure proper component arguments and parameters in Pre- conditions Performance data collector and evaluator –Collect and evaluate a component’s performance in Post- conditions Exception handler –Handle contract-raised exceptions –Perform CQoS-related tasks, e.g., Proxy that handles external calls to CQoS functions Adaptive decision maker

10 10 Outline Introduction to CQoS and Interface Contracts Contract Enforcement in CQoS Application Use Cases Ongoing and Future Work

11 11 Towards Optimal Petascale Simulations (TOPS) int computeResidual(in array x, in array f) throws sidl.PreViolation, sidl.PostViolation; require not_null_x : x != null; not_null_f : f != null; x_is_2d: dimen(x) == 2; f_is_2d : dimen(f) == 2; ensure non_negative_result: result > 0; Parallel (non-)linear algebraic solver components Incorporate CQoS capabilities to facilitate adaptive solver selection at runtime Enforce interface contract to –Ensure proper TOPS parameter and component use –Conduct performance check and adaptation action(s) by calling CQoS functions www.scidac.gov/math/TOPS.html Towards Optimal Petascale Simulations

12 12 2D Driven Cavity Flow 1 1 T. S. Coffey, C.T. Kelley, and D.E. Keyes. Pseudo-transient continuation and differential algebraic equations. SIAM J. Sci. Comp, 25:553–569, 2003. Parallel driven cavity flow model in a two-dimensional rectangular cavity Nonlinear PDE-based test case in CQoS testbed Linear solver: GMRES(30), vary only fill level of ILU preconditioner Adaptive heuristic based on: –Matrix properties (which change during runtime) computed with Anamod (Eijkhout, http://sourceforge.net/projects/salsa/ )http://sourceforge.net/projects/salsa/ Enforce contract to –Evaluate linear solver performance in post-conditions –Handle solver failure –Make adaptation decision, adjust fill level of preconditioner

13 13 interface Solver extends gov.cca.Port, AdaptiveDriver.PerfEvaluator { … void solve(out TypeMap perfData) throws sidl.PostViolation; ensure perf_evaluator: slowConvergence(perfData) == true; … } Definition of a linear solver that examines performance using interface contract and user-defined evaluation function. AdaptiveDriver::AdaptiveContext adaptCnxt = AdaptiveDriver::AdaptiveContext::_create(); … try { KSPsolver.solve(perfData); } catch (::sidl::PostViolation _ex){ std::cerr << “There is performance problem with this run.” << std::endl; AdaptiveDriver::AdaptiveSolver kspSolver = AdaptiveDriver::AdaptiveSolver::_create() ; adaptCnxt.setAdaptiveSolver(kspSolver); adaptCnxt.setAdaptiveType(ADAPTIVE_KSP); adaptCnxt.AdaptApply(); } Implementation code that calls the solver and processes poor-performed solver run with adaptation functions. package AdaptiveDriver version 1.0{ /* This interface evaluates performance of a solver.*/ interface PerfEvaluator { bool slowConvergence(in TypeMap perfResult); } /* This class deals with context change * and applies solver adaptation. */ class AdaptiveContext { int AdaptApply(); opaque getAdaptiveSolver(); void setAdaptiveSolver(in opaque algo); void setAdaptiveType(in int type); … … } /* This class makes solver adaptation decision, * may invoke CQoS functions. */ class AdaptiveSolver { int adapt(inout opaque A); } /* This class uses CQoS DB functions to manage * performance and meta-info. */ class DataManagement { void storeData(in TypeMap data); void retrieveData(inout TypeMap data); } SIDL file that defines performance evaluation, adaptation, and data management functions.

14 14 Outline Introduction to CQoS and Interface Contracts Contract Enforcement in CQoS Application Use Cases Ongoing and Future Work

15 15 Ongoing and Future Work Develop regression tests for contract-enhanced components, e.g., TOPS components Generalize CQoS-related contract enforcement in component interface specification Apply to more problem domains, implementing extensions as necessary

16 16 Acknowledgements to Collaborators CCA Forum members Funding: DOE Scientific Discovery through Advanced Computing (SciDAC) program Thank you!


Download ppt "Interface Contract Enforcement for Improvement of Computational Quality of Services (CQoS) for Scientific Components Li Li 1, Tamara L. Dahlgren 2, Lois."

Similar presentations


Ads by Google