Data-Parallel Spreadsheet Programming

Data-Parallel Spreadsheet Programming

Data-Parallel Spreadsheet Programming Florian Biermann Advisor: Peter Sestoft Submitted: June 2018 ii Abstract Spreadsheets are used in industry and academia across all domains and their application ranges from simple accounting to sequencing of amino acids. Some businesses re-use and extend spreadsheets over years and not only complexity but also performance becomes a problem. In the last two decades, parallel shared-memory multiprocessor computers have become abundant, but they remain notoriously difficult to program correctly. Therefore, it is often not possible for end-users to make full use of their parallel hardware. Declarative, functional programming languages are an alterna- tive to imperative programming languages that makes program- ming shared-memory multiprocessors much easier: due to the ab- sence of side effects in these languages, compilers and libraries can parallelize programs automatically. The formula language of spread- sheets is a declarative, first-order functional language and therefore potentially allows for an automatic parallelization of spreadsheet calculations. This thesis explores the design space of automatically paral- lelizing spreadsheet recalculations. Often times, computations in spreadsheets are structured in a way that corresponds to declarative high-level programming on arrays. Therefore, the focus of this thesis lies on practical data-parallelism in a spreadsheet model of computations. This thesis makes the following contributions: • we show how to automatically re-write high-level spreadsheet structures into higher-order functional programs for parallel execution; • we contrast and combine our re-writing technique with a recalculation algorithm that dynamically exploits dataflow parallelism in spreadsheets; • we describe a representation of two-dimensional arrays that pragmatically caters to the needs of high-level array program- ming; and • we explore a hypothetical approach to array fusion and lazi- ness in a purely functional, strict spreadsheet language. iii Resumé Regneark bruges i forretning og forskning bland alle domæner og deres anvendelse rækker fra enkle regnskaber til sekventering af aminosyrer. Nogle virksomheder genbruger og udvider regneark over mange år, og ikke blot kompleksiteten, men også hastigheden af beregningerne kan blive til et problem. I de sidste tyve år er processorer med mange regnekerner og delt hukommelse blevet udbredt overalt. Det er dog fortsæt svært at programmere disse maskiner korrekt. Det er derfor ofte ikke muligt for slutbrugere at udnytte deres parallelle udstyr. Deklarativ funktionsprogrammering er et alternativ til impera- tive programmeringssprog og gør programmering af regnekerner med delt hukommelse meget nemmere: takket være fraværet af sideeffekter i disse sprog kan oversættere og biblioteker automatisk parallelisere programmer. Formelsproget i regneark er et deklarativt første-ordens funktionssprog og har derfor potentiale for automatisk parallelisering af beregninger i en regneark. Denne afhandling udforsker designrummet for automatisk pa- rallelisering af regnearksberegninger. Det sker ofte at beregningerne i en regneark er struktureret på en måde, som svarer til deklarativ højere-ordens programmering på matricer. Derfor ligger vores fo- kus i denne afhandling på praktisk anvendelig data-parallelisme i regneark. Denne afhandling indeholder følgende bidrag: • vi viser hvordan visse strukturer i regneark kan omskrives til højere-ordens funktionsprogrammer som kan eksekveres i parallelt; • vi sammenligner og derefter kombinerer vi vores omskriv- ningsteknik med en genberegningsalgoritme som dynamisk udnytter datastrømparallelisme i regneark; • vi beskriver en repræsentation af matricer af to dimensioner, som ganske pragmatisk imødekommer matrixprogrammering på et abstrakt niveau; og til sidst • udforsker vi en hypotetisk tilgang til en teknik til elimination af mellemresultater på matricer og dovnskab i et funktions- programmeringssprog i regneark uden sideefekter. iv Zusammenfassung Kalkulationstabellen, im allgemeinen Sprachgebrauch oft “Excel Tabellen”, werden in allen Disziplinen, sowohl in der Industrie als auch an der Akademie, genutzt, und ihre Nutzung reicht von einfacher Buchhaltung bis zur Sequenzierung von Aminosäuren. Manche Firmen benutzen und erweitern Kalkulationstabellen über Jahre hinweg und nicht nur deren Komplexität, sondern auch die Geschwindigkeit der Berechnungen wird problematisch. In den letzten beiden Jahrzehnten sind Multiprozessoren mit gemeinsam genutztem Speicher allgegenwärtig geworden, aber ihre korrekte Programmierung ist weiterhin notorisch schwierig. Deswegen ist es für Endnutzer oft nicht möglich ihre parallele Computerhardware vollständig auszunutzen. Deklarative, funktionale Programmiersprachen bilden eine Al- ternative zu imperativen Programmiersprachen und machen es einfacher, Multiprozessoren mit gemeinsam genutztem Speicher zu programmieren: dank der Abwesenheit von Nebeneffekten können Kompiler und Bibliotheken Programme automatisch parallelisieren. Die Formelsprache in Kakulationstabellen ist eine deklarative, funk- tionale Programmiersprache erster Ordnung und erlaubt deswegen potentiell, Tabellenkalkulationen zu parallelisieren. Diese Dissertation erforscht den Gestaltungsraum der automa- tischen Parallelisierung von Tabellenkalkulationen. Die Struktur von Kalkulationstabellen korreliert oft mit deklarativen, höheren Programmkonstrukten auf Matrizen. Deswegen konzentrieren wir uns auf praktisch anwendbarer Datenparallelität in Tabellenkalku- lationen. Diese Dissertation macht die folgenden Beiträge: • wir zeigen, wie höhere Strukturen in Kalkulationstabellen automatisch in höhere funktionale Programme umgeschrieben werden können um deren Berechnung zu parallelisieren; • wir stellen unserer Umschreibetechnik einen Algorithmus zur Neuberechnung von Kalkulationstabellen gegenüber, der dy- namisch deren parallelen Datenfluss ausnutzt; • wir beschreiben eine Darstellung von Matrizen die pragma- tisch die Anforderungen von höherem Matrizenprogrammie- ren erfüllt; und schließlich • erkunden wir eine hypothetische Herangehensweise zur Eli- minierung von Zwischenergebnissen auf Matrizen und deren Bedarfsauswertung in einer rein funktionalen, strikten Tabel- lenkalkulationssprache. v Acknowledgements First of all, I would like to thank my supervisor Peter Sestoft: for giving me the chance to pursue a PhD in the first place and for his continuous support and guidance. Peter has greatly influenced how I think about technical and scientific problems. Thanks to Peter Eklund and John Paulin Hansen for keeping me at the IT University long enough until the opportunity for this PhD arose. Thanks to my co-authors Alexander Asp Bock, Wensheng Dou and Peter Sestoft for interesting technical discussions and a fruitful collaboration. Thanks to Wensheng for hosting me during my second stay at the Chinese Academy of Sciences in 2017. Thanks to Zhang Yu and Prof. Huimin Lin for hosting me during my first stay at CAS in 2016. Thanks to our student programmers Holger Stadel Borum and Malthe Ettrup Kirkbro for continuously improving Funcalc over the last two years and thereby making some of my work possible in the first place. Also thanks to the former and current members of the SQUARE group for providing a platform for discussions and feedback. Thanks to Paolo Tell for continuously mentoring me on aca- demic matters over the last four years while being the only reliable source of high-quality coffee in the 4D wing. Thanks to Peter Sestoft, Dino Ott and Johan von Tangen Sivert- sen, who all gave valuable feedback that greatly improved the quality of this dissertation. Thanks the Sino-Danish Center for Education and Research for supporting my PhD financially. Thanks to my friends and family and thanks to everyone who has supported me and in some way or another has contributed to me finishing this project. Line: danke! Contents Contents vii 1 Introduction 1 1.1 Contributions ............................ 2 1.2 Thesis Outline ............................ 3 1.3 Experiments ............................. 5 I Background 7 2 Spreadsheets 9 2.1 Basic Concepts ............................ 9 2.2 Formal Semantics of Spreadsheets ................... 12 2.3 Funcalc and Sheet-Defined Functions .................. 18 2.4 Related Work ............................ 20 3 Declarative Array Programming 25 3.1 Array Combinators .......................... 26 3.2 Array Programming in Funcalc ..................... 30 3.3 Related Work ............................ 37 II Contributions 43 4 Rewriting Cell Arrays 45 4.1 Introduction ............................. 45 4.2 From Spreadsheets to Higher-Order Functional Programs ........ 46 4.3 Systematically Rewriting Cell Arrays .................. 51 4.4 Implementation ........................... 60 viii Contents 4.5 Performance ............................. 62 4.6 Alternative Usages and Related Work .................. 68 4.7 Conclusion .............................. 69 5 Spreadsheet Dataflow Parallelism 71 5.1 Introduction ............................. 71 5.2 Funcalc: Sequential Implementation .................. 72 5.3 Puncalc: Parallel Implementation ................... 74 5.4 Results and Validation ........................ 87 5.5 Related Work ............................ 92 5.6 Combining Dataflow with Cell Array Rewriting .............. 93 5.7 Conclusion .............................. 96 6 End-User Array Programming 97 6.1 Introduction ............................. 97 6.2 Quad Rope Semantics ........................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    199 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us