7 research outputs found

    Adat és kiértékelési függőségi elemzés funkcionális nyelvekre-Erlang programok statikus elemzése

    Get PDF
    A szoftverfejlesztést támogató eszközök jelentősége rohamosan nő az utóbbi évtizedekben. A forráskódok mérete akkorára nő, hogy humán erővel átlátni szinte lehetetlen, de legalábbis nehézkes és időigényes folyamat. Így egyre inkább elterjednek azok az eszközök, melyek a kód megértést, karbantartást, hibakeresést támogatnak vagy éppen lehetőséget nyújtanak a forráskód különböző szempontok szerinti refaktorálására. Ez a támogatás történhet dinamikusan, azaz futási időben, illetve statikusan, azaz fordı́tási időben. Előbbi esetben a már futó szoftver monitorozásával, esetlegesen a kód instrumentálásával nyerhetünk ki információt és segı́thetjük ezzel a fejlesztőket. Utóbbi esetben viszont nincs szükség a szoftver futtatására, csupán a forráskód alapján gyűjtünk információt és használjuk fel különböző célokra. Dolgozatomban ez utóbbi módszerrel, a forráskódok statikus elemzésével foglalkoztam, Erlang nyelvhez. Definiáltam Erlang programok elsőrendű adatfolyam-gráfját, és az ezen a gráfon értelmezett elsőrendű adatfolyam relációt. A RefactorErl keretrendszer alap eszközkészletéhez igazı́tva megadtam az ehhez tartozó algoritmusokat. Erlang programok adatfolyam-gráfját ı́gy inkrementálisan fel tudjuk épı́teni a forráskódok változásának figyelembe vételével. A adatfolyam reláció segı́tségével pedig választ kaphatunk olyan kérdésekre, hogy mi lehet a program egy adott pontján lévő kifejezésének az értéke, illetve hogy egy adott érték milyen programpontokra juthat el. A reláció interprocedurálisan számı́tható és figyelembe veszi a hı́vási kontextust. Az adatfolyam relációt felhasználásával megadtam, hogyan számı́tható ki az aszinkron üzenetküldések és -fogadások közötti közvetlen adatfolyam. Definiáltam Erlang programokon értelmezett adatfüggőség relációt, mely az adatfolyam-gráf kiterjesztésén a viselkedésfüggőség gráfon számı́tható ki. A függőségi reláció megadja, hogy két Erlang programbeli kifejezés között van-e függés, azaz kiértékelésük függ-e egymástól. A RefactorErl keretrendszerhez kidolgozott algoritmusok felhasználásra kerültek olyan problémák megoldásában mint a releváns tesztesek kiválasztása, vagy párhuzamosı́tható komponensek függőségi kapcsolatainak az ellenőrzése. Az adatfolyam, adatfüggőség és egyéb statikus elemzések felhasználásával kidolgoztam különböző jól párhuzamosı́tható számı́tási modellek viselkedésének leı́rását, mint például az elemenkénti feldolgozás. A megadott szabályok alapján a RefactorErl keretrendszerben megadhatók azok a mintafelismerési algoritmusok, melyek segı́tségével azonosı́thatóak azok a szekvenciális kódrészletek, melyek lecserélhetőek egy ekvivalens párhuzamos végrehajtásra

    Parallel Patterns for Agent-based Evolutionary Computing

    Get PDF
    Computing applications such as metaheuristics-based optimization can greatly benefit from multi-core architectures available on modern supercomputers. In this paper, we describe an easy and efficient way to implement certain population-based algorithms (in the discussed case, multi-agent computing system) on such runtime environments. Our solution is based on an Erlang software library which implements dedicated parallel patterns. We provide technological details on our approach and discuss experimental results

    Static Analysis for Divide-and-Conquer Pattern Discovery

    Get PDF
    Routines implementing divide-and-conquer algorithms are good candidates for parallelization. Their identifying property is that such a routine divides its input into "smaller" chunks, calls itself recursively on these smaller chunks, and combines the outputs into one. We set up conditions which characterize a wide range of d&c routine definitions. These conditions can be verified by static program analysis. This way d&c routines can be found automatically in existing program texts, and their parallelization based on semi-automatic refactoring can be facilitated. We work out the details in the context of the Erlang programming language

    Towards Trustworthy Refactoring in Erlang

    Get PDF
    Tool-assisted refactoring transformations must be trustworthy if programmers are to be confident in applying them on arbitrarily extensive and complex code in order to improve style or efficiency. We propose a simple, high-level but rigorous, notation for defining refactoring transformations in Erlang, and show that this notation provides an extensible, verifiable and executable specification language for refactoring. To demonstrate the applicability of our approach, we show how to define and verify a number of example refactorings in the system.Comment: In Proceedings VPT 2016, arXiv:1607.0183

    JIT-based cost models for adaptive parallelism

    Get PDF
    Parallel programming is extremely challenging. Worse yet, parallel architectures evolve quickly, and parallel programs must often be refactored for each new architecture. It is highly desirable to provide performance portability, so programs developed on one architecture can deliver good performance on other architectures. This thesis is part of the AJITPar project that investigates a novel approach for achieving performance portability by the development of suitable cost models to inform scheduling decisions with dynamic information about computational and communication costs on the target architecture. The main artifact of the AJITPar project is the Adaptive Skeleton Library (ASL) that pro- vides a distributed-memory master-worker implementation of a set of Algorithmic Skeletons i.e. programming patterns that abstract away the low-level intricacies of parallelism. After JIT warm-up, ASL uses a computational cost model applied to JIT trace information from the Pycket compiler, a tracing JIT implementation of the Racket language, to transform the skeletons. The execution time of an ASL task is primarily determined by computation and communication costs. The Pycket compiler is extended to enable runtime access to JIT traces, both the sequences of instructions and frequency of execution. Crucially for dynamic, adaption these are obtained with minimal overhead. A low cost, dynamic computation cost model for estimating the runtime of JIT compiled Pycket programs, Γ, is developed and validated. This is believed to be the first such model. The design explores the challenges of estimating execution time from JIT trace instructions and presents three increasingly sophisticated cost models. The cost model predicts execution time based on the PyPy JIT instructions present in compiled JIT traces. The final abstract cost model applies weightings for 5 different classes of trace instructions and also proposes a method for aggregating the cost models for single traces into a cost model for an entire program. Execution time is measured, and traces generated are recorded, from a suite of 41 benchmarks. Linear regression is used to determine the weightings for the abstract cost model from this data. The final cost model reveals that allocation operations count most for execution time, followed by guards and numeric operations. The suitability of Γ for predicting the effect of ASL program transformations is investigated. The real utility of Γ is not in absolute predictions of execution times for different programs, but in predicting the effects of applying program transformations on parallel programs. A linear relationship between the actual computational cost for a task, and that predicted by Γ for five benchmarks on two architectures is demonstrated. A series of increasingly accurate low cost, dynamic cost models for estimating the communi- cation costs of ASL programs, K, are developed and validated. Predicting the optimum task size in ASL not only relies on computational cost predictions, but also predictions of the over- head of communicating tasks to worker nodes and results back to the master. The design and iterative development of a cost model which predicts the serialisation, deserialisation, and network send times of spawning a task in ASL is presented. Linear regression of communication timings are used to determine the appropriate weighting parameters for each. K is shown to be valid for predicting other, arbitrary data structures by demonstrating an additive property of the model. The model K is validated by showing a linear relationship between the combined predicted costs of the simple types in instances of aggregated data structures, and measured communication time. This validation is performed on five benchmarks on two platforms. Finally, a low cost dynamic cost model, T , that predicts a good ASL task size by combining information from the computation and communication cost models (Γand K) is developed and validated. The key insight in the design in this model is to balance the communications cost on the master node with the computational and communications cost on the worker nodes. The predictive power of T is tested model using six benchmarks, and it is shown to more accurately predict the optimal task size, reducing total program runtimes when compared with the default ASL prototype

    Refactorings to Enable Parallelization

    No full text
    corecore