Trends in Functional Programming Volume 10
eBook - ePub
Available until 23 Dec |Learn more

Trends in Functional Programming Volume 10

  1. 189 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub
Available until 23 Dec |Learn more

About this book

Volume 10 in the Trends in Functional Programming (TFP) series presents some of the latest research results in the implementation of functional programming languages and the practice of functional programming. It contains a peer-reviewed selection of the best articles presented at the 2009 Tenth Symposium on Trends in Functional Programming held in Komárno, Slovakia. TFP 2009 was co-located with the Third Central European Functional Programming School (CEFP 2009) and organized by the Department of Programming Languages and Compilers, Faculty of Informatics, Eötvös Loránd University, Budapest and the Selye János University, Komárno.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Trends in Functional Programming Volume 10 by Zoltán Horváth, Viktória Zsók, Zoltán Horváth,Viktória Zsók, Zoltan Horvath, Viktoria Zsok in PDF and/or ePUB format, as well as other popular books in Art & Art General. We have over one million books available in our catalogue for you to explore.

Information

Year
2014
Print ISBN
9781841504056
eBook ISBN
9781841504421
Edition
1
Topic
Art
Subtopic
Art General

Chapter 1

Graph-based Communication in Eden

Thomas Horstmeyer and Rita Loogen1
Category: Research
Abstract: We present a new approach to the definition and creation of process topologies in the parallel functional Haskell extension Eden. Grace (Graph-based communication in Eden) allows a programmer to specify a network of processes as a graph, where the graph nodes represent processes and the edges represent communication channels. This simplifies the specification and creation of complex communication topologies a lot. The main benefit of the new approach is the clean separation between coordination and computation. Runtime experiments show that Grace has a marginal overhead in comparison with traditional Eden code.

1.1 INTRODUCTION

The parallel functional language Eden [8] enables programmers to define process networks with arbitrary topologies. However, the creation of a non-tree-like topology had up to now to be done on a low level of abstraction, using so-called ‘dynamic channels’. These channels are created by receiver processes and must be passed to the corresponding sender processes to establish a direct channel connection between those processes. This is a rather tedious and error-prone task.
In this paper, we present a new approach to the definition and creation of process topologies in Eden. Grace (Graph-based communication in Eden) allows a programmer to specify a network of processes as a graph, where the graph nodes represent processes and the edges represent communication channels. The graph is described as a Haskell data structure ProcessNetwork a, where a is the result type of the network computation. A function start will instantiate the network and automatically set up the corresponding process topology, i.e. the processes are created and the necessary communication channels are installed. The main benefit of the new approach is the clean separation between coordination and computation. The network specification encapsulates the coordinational aspects. The graph nodes are annotated with functions describing the computations of the corresponding processes.
image
FIGURE 1.1. Network Topology for the Sums of Elements in the Pascal’s Triangle
Generally, a user defines the process network by placing functions on nodes and connecting the nodes with edges. For every parameter that a function takes, the corresponding node must have an incoming edge. An ordering on incoming edges maps them unambiguously to the parameters. The result computed on a node will be transmitted over every outgoing edge to other nodes. Since not every successor node might need the whole result, an optional transformation function can be placed on edges that filters the data to be transmitted before the transfer. No filtering is expressed using nothing2. A small extension to the base system allows the definition of multiple incoming edges for a parameter of list type, which then will be received element-wise over those edges.
An Introductory Example
Let us take a look at a simple network that computes the sequence
image
with x1 = 1 and xi = 2xi−1 + 1 for all i > 1. Here, xn gives you the sum of the elements in the Pascal’s triangle with n levels. We use two separate processes to compute the multiplication and the addition. Figure 1.1 visualizes the network.
Listing 1.1 shows how to describe this network with the help of Grace. It uses the data types and functions of the Grace package shown in Listing 1.2. The network is specified as a graph structure that is passed to the Grace function build. It consists of the node for the main process where the sums function is evaluated, two nodes labelled “mult” and “add” for the separate processes, and edges connecting the nodes. The third and fourth parameter of the edge constructor E are not of interest in this small example. Applying the function start to the network will instantiate its processes, build the communication channels and compute the result.
Listing 1.1. Element Sums in the Pascal’s Triangle with Grace
image
Listing 1.2. Some Data Types and Functions of the Grace Package
image
Plan of Paper. The next section contains a short introduction to Eden. Basic constructs of Grace are explained in Section 1.3. Advanced constructs follow in Section 1.4. Implementation details are discussed in Section 1.5, while an experimental evaluation is presented in Section 1.6. Section 1.7 gives an implementation of the hyperquicksort algorithm that uses all of Grace’s features. The paper finishes with a discussion of related work in Section 1.8 and conclusions in Section 1.9.

1.2 EDEN

The parallel Haskell dialect Eden [8] extends Haskell [9] with an explicit notion of processes (function applications evaluated remotely in parallel). The programmer has direct control over evaluation site, process granularity, data distribution and communication topology, but does not have to manage synchronization and data exchange between processes. The latter are performed by the parallel runtime system through implicit communication channels, transparent to the programmer.
The essential two coordination constructs of Eden are process abstraction and instantiation:
 process :: (Trans a, Trans b) ⇒ (a → b) → Process a b ( # ) :: (Trans a, Trans b) ⇒ Process a b → a → b
The function process embeds functions of type a → b into process abstractions of type Process a b where the context (Trans a, Trans b) states that both a and b must be types belonging to the Trans class of transmissible values. Evaluation of an expression (process funct) # arg leads to the creation of a new process for evaluating the application of the function funct to the argument arg. The type class Trans provides overloaded communication functions for lists, which are transmitted as streams, element by element, and for tuples, which are evaluated component-wise by concurrent threads in the same process. An Eden process can thus contain a variable number of threads during its lifetime.
Two additional non-functional features of Eden are essential for performance optimizations and the creation of non-hierarchical process networks: non-deterministic stream merging and explicit communication. Eden’s non-deterministic function merge :: Trans a ⇒ [[a]] → [a] merges a list of streams into a single stream and thus provides many-to-one communication. Communication channels may be created implicitly during process creation – in this case we call them static channels – or explicitly during process evaluation. In the latter case we call them dynamic channels. The following functions provide the interface to create and use dynamic channels:
 new :: Trans a ⇒ (ChanName a → a → b) → b parfill :: Trans a ⇒ ChanName a → a → b → b
Evaluating new (λ name val → e), a process creates a dynamic channel name of type ChanName a in order to receive a value val o...

Table of contents

  1. Cover
  2. Title Page
  3. Copyright
  4. Preface
  5. Organization
  6. Contents
  7. Chapter 1 Graph-based Communication in Eden
  8. Chapter 2 Compiling Concurrency Correctly: Cutting Out the Middle Man
  9. Chapter 3Towards Compiling Sac to Cuda
  10. Chapter 4 Low Pain vs No Pain Multi-core Haskells
  11. Chapter 5 An Operational Semantics for Distributed Lazy Evaluation
  12. Chapter 6 On Graph Rewriting, Reduction and Evaluation
  13. Chapter 7 A Reflection-based Proof Tactic for Lattices in Coq
  14. Chapter 8 Generic Programming for Domain Reasoners
  15. Chapter 9 Haskell Module Tools for Liberating Type Class Design
  16. Chapter 10 Signals, Not Generators!
  17. Chapter 11 Braincurry: A Domain- specific Language for Integrative Neuroscience
  18. Author Index