Orca A language for parallel programming of distributed systems.

Slides:



Advertisements
Similar presentations
Formal Semantics of Programming Languages 虞慧群 Topic 6: Advanced Issues.
Advertisements

Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
An Overview of PROMELA. A protocol Validation Language –A notation for the specification and verification of procedure rules. –A partial description of.
Distributed Shared Memory
The Spin Model Checker Promela Introduction Nguyen Tuan Duc Shogo Sawai.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Distributed systems Programming with threads. Reviews on OS concepts Each process occupies a single address space.
Monitors Chapter 7. The semaphore is a low-level primitive because it is unstructured. If we were to build a large system using semaphores alone, the.
Introduction in algorithms and applications Introduction in algorithms and applications Parallel machines and architectures Parallel machines and architectures.
Distributed systems Programming with threads. Reviews on OS concepts Each process occupies a single address space.
DISTRIBUTED AND HIGH-PERFORMANCE COMPUTING CHAPTER 7: SHARED MEMORY PARALLEL PROGRAMMING.
Remote Procedure Call in SR Programming Language By Tze-Kin Tsang 3/20/2000.
Introduction in algorithms and applications Introduction in algorithms and applications Parallel machines and architectures Parallel machines and architectures.
Note The “Scientific Visualization” class starts this Tuesday (2 November) 11 am, S1.11 See
Chapter 11: Distributed Processing Parallel programming Principles of parallel programming languages Concurrent execution –Programming constructs –Guarded.
RPC Project Using either sockets or TLI, implement Remote Procedure Calls between two distinct machines that are communicating over an Ethernet network.
Multiple Processor Systems 8.1 Multiprocessors 8.2 Multicomputers 8.3 Distributed systems.
CS 603 Threads, Processes, and Agents March 18, 2002.
Communication in Distributed Systems –Part 2
Implementing Remote Procedure Calls an introduction to the fundamentals of RPCs, made during the advent of the technology. what is an RPC? what different.
Asynchronous Message Passing EE 524/CS 561 Wanliang Ma 03/08/2000.
Distributed Systems Lecture # 3. Administrivia Projects –Design and Implement a distributed file system Paper Discussions –Discuss papers as case studies.
Advances in Language Design
SEC(R) 2008 Intel® Concurrent Collections for C++ - a model for parallel programming Nikolay Kurtov Software and Services.
Lecture 4: Parallel Programming Models. Parallel Programming Models Parallel Programming Models: Data parallelism / Task parallelism Explicit parallelism.
Networked File System CS Introduction to Operating Systems.
Inter-process Communication and Coordination Chaitanya Sambhara CSC 8320 Advanced Operating Systems.
Object-Oriented Implementation of Reconciliations M.Sc. Seminar Talk by Costa Shapiro under supervision of Prof. Shmuel Katz Computer Science – Technion.
Oct Multi-threaded Active Objects Ludovic Henrio, Fabrice Huet, Zsolt Istvàn June 2013 –
Threads, Thread management & Resource Management.
1 OpenMP Writing programs that use OpenMP. Using OpenMP to parallelize many serial for loops with only small changes to the source code. Task parallelism.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Programming Language C++ Xulong Peng CSC415 Programming Languages.
Computer Science Department Data Structure & Algorithms Lecture 8 Recursion.
Problems with Send and Receive Low level –programmer is engaged in I/O –server often not modular –takes 2 calls to get what you want (send, followed by.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
Chapter 3 Parallel Programming Models. Abstraction Machine Level – Looks at hardware, OS, buffers Architectural models – Looks at interconnection network,
1 Concurrency Architecture Types Tasks Synchronization –Semaphores –Monitors –Message Passing Concurrency in Ada Java Threads.
A Brief Documentation.  Provides basic information about connection, server, and client.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
Parallel execution Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
ICS 313: Programming Language Theory Chapter 13: Concurrency.
PZ12B Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ12B - Synchronization and semaphores Programming Language.
Synchronization and semaphores Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Remote Procedure Call Andy Wang Operating Systems COP 4610 / CGS 5765.
Orca A language for parallel programming of distributed systems.
Mark Stanovich Operating Systems COP Primitives to Build Distributed Applications send and receive Used to synchronize cooperating processes running.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 24 Critical Regions.
1 Chapter 9 Distributed Shared Memory. 2 Making the main memory of a cluster of computers look as though it is a single memory with a single address space.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Wide-Area Parallel Computing in Java Henri Bal Vrije Universiteit Amsterdam Faculty of Sciences vrije Universiteit.
Distributed shared memory u motivation and the main idea u consistency models F strict and sequential F causal F PRAM and processor F weak and release.
1 Programming Languages (CS 550) Lecture 2 Summary Mini Language Interpreter Jeremy R. Johnson.
3/12/2013Computer Engg, IIT(BHU)1 OpenMP-1. OpenMP is a portable, multiprocessing API for shared memory computers OpenMP is not a “language” Instead,
Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.
A Parallel Communication Infrastructure for STAPL
Object-Based Distributed Shared Memory
“Language Mechanism for Synchronization”
Programming with ANSI C ++
Computer Engg, IIT(BHU)
CS603 Communication Mechanisms
Monitors Chapter 7.
Parallel execution Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Background and Motivation
Monitors Chapter 7.
Subject : T0152 – Programming Language Concept
Monitors Chapter 7.
Synchronization and semaphores
Presentation transcript:

Orca A language for parallel programming of distributed systems

Orca Parallel language designed at VU Design and first implementation (‘88-’92): –Bal, Kaashoek, Tanenbaum Portable Orca system (‘93-’97): –Bal, Bhoedjang, Langendoen, Rühl, Jacobs, Hofman Used by ~30 M.Sc. Students

Overview Shared data-object model Processes Condition synchronization Example: TSP

Orca’s Programming Model Explicit parallelism (processes) Communication model: –Shared memory: hard to build –Distributed memory: hard to program Idea: shared memory programming model on distributed memory machine Form of Distributed shared memory (DSM)

Shared Data-object Model Shared data encapsulated in objects Object = variable of abstract data type Shared data accessed by user-defined, high-level operations Object Local data Enqueue( ) Dequeue( )

Semantics Each operation is executed atomically –As if operations were executed 1 at a time –Mutual exclusion synchronization –Similar to monitors Each operation applies to single object –Allows efficient implementation –Atomic operations on multiple objects are seldom needed and hard to implement

Implementation System determines object distribution It may replicate objects (transparently) Single-copy object Network CPU 1CPU 2 Replicated object Network CPU 1CPU 2

Object Types Abstract data type Two parts: 1Specification part ADT operations 2Implementation part Local data Code for operations Optional initialization code

Example: Intobject Specification part object specification IntObject; operation Value(): integer; operation Assign(Val: integer); operation Min(Val: integer); end; object specification IntObject; operation Value(): integer; operation Assign(Val: integer); operation Min(Val: integer); end;

Intobject Implementation Part object implementation IntObject; X: integer; # internal data of the object operation Value(): integer; begin return X; end; operation Assign(Val: integer); begin X := Val; end operation Min(Val: integer); begin IF Val < X THEN X := Val; FI; end; object implementation IntObject; X: integer; # internal data of the object operation Value(): integer; begin return X; end; operation Assign(Val: integer); begin X := Val; end operation Min(Val: integer); begin IF Val < X THEN X := Val; FI; end;

Usage of Objects # declare (create) object MyInt: IntObject; # apply operations to the object MyInt$Assign(5); tmp := MyInt$Value(); # atomic operation MyInt$Min(4); # multiple operations (not atomic) IF MyInt$Value() > 4 THEN MyInt$Assign(4); FI; # declare (create) object MyInt: IntObject; # apply operations to the object MyInt$Assign(5); tmp := MyInt$Value(); # atomic operation MyInt$Min(4); # multiple operations (not atomic) IF MyInt$Value() > 4 THEN MyInt$Assign(4); FI;

Parallelism Expressed through processes –Process declaration: defines behavior –Fork statement: creates new process Object made accessible by passing it as shared parameter (call-by-reference) Any other data structure can be passed by value (copied)

Example (Processes) # declare a process type process worker(n: integer; x: shared IntObject); begin #do work... x$Assign(result); end; # declare an object min: IntObject; # create a process on CPU 2 fork worker(100, min) on (2); # declare a process type process worker(n: integer; x: shared IntObject); begin #do work... x$Assign(result); end; # declare an object min: IntObject; # create a process on CPU 2 fork worker(100, min) on (2);

Structure of Orca Programs Initially there is one process (OrcaMain) A process can create child processes and share objects with them Hierarchy of processes communicating through objects No lightweight treads

Condition Synchronization Operation is allowed to block initially –Using one or more guarded statements Semantics: –Block until 1 or more guards are true –Select a true guard, execute is statements operation name(parameters); guard expr-1 do statements-1; od;.... guard expr-N do statements-N od; end; operation name(parameters); guard expr-1 do statements-1; od;.... guard expr-N do statements-N od; end;

Example: Job Queue object implementation JobQueue; Q: “queue of jobs”; operation addjob(j: job); begin enqueue(Q,j); end; operation getjob(): job; begin guard NotEmpty(Q) do return dequeue(Q); od; end; object implementation JobQueue; Q: “queue of jobs”; operation addjob(j: job); begin enqueue(Q,j); end; operation getjob(): job; begin guard NotEmpty(Q) do return dequeue(Q); od; end;

Traveling Salesman Problem Structure of the Orca TSP program JobQueue and Minimum are objects Master Slave JobQueueMinimum

Performance Issues Orca provides high level of abstraction  easy to program  hard to understand performance behavior Example: X$foo() can either result in: –function call (if X is not shared) –monitor call (if X is shared and stored locally) –remote procedure call (if X is stored remotely) –broadcast (if X is replicated)

Performance model The Orca system will: –replicate objects with a high read/write-ratio –store nonreplicated object on ``best’’ location Communication is generated for: –writing replicated object (broadcast) –accessing remote nonreplicated object (RPC) Programmer must think about locality

Summary of Orca Object-based distributed shared memory –Hides the underlying network from the user –Applications can use shared data Language is especially designed for distributed systems User-defined, high-level operations