Abstract Memory The TupleSpace

Similar documents
Linda, JavaSpaces & Jini

CA341 - Comparative Programming Languages

CMSC 714 Lecture 4 OpenMP and UPC. Chau-Wen Tseng (from A. Sussman)

Working with Databases and Java

Distributed Shared Memory

Middleware-Konzepte. Tuple Spaces. Dr. Gero Mühl

EECS 647: Introduction to Database Systems

Advanced SQL GROUP BY Clause and Aggregate Functions Pg 1

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING

Lecture 2 Process Management

Parallel Computing Using OpenMP/MPI. Presented by - Jyotsna 29/01/2008

Allows program to be incrementally parallelized

Asynchronous Events on Linux

DbSchema Forms and Reports Tutorial

A Message Passing Standard for MPP and Workstations. Communications of the ACM, July 1996 J.J. Dongarra, S.W. Otto, M. Snir, and D.W.

Department of Computer Science Admission Test for PhD Program. Part I Time : 30 min Max Marks: 15

Chapter 27 Cluster Work Queues

DbSchema Forms and Reports Tutorial

Chapel Introduction and

INTERMEDIATE SQL GOING BEYOND THE SELECT. Created by Brian Duffey

CS 241 Honors Concurrent Data Structures

Lecture 9. Part I. Overview of Message Passing. Communication Coupling. Decoupling Blackboard. Decoupling Broadcast. Linda and Erlang.

Midterm I October 12 th, 2005 CS162: Operating Systems and Systems Programming

MPI and OpenMP (Lecture 25, cs262a) Ion Stoica, UC Berkeley November 19, 2016

Intermediate MPI features

Parallel Debugging. ª Objective. ª Contents. ª Learn the basics of debugging parallel programs

Inter-process communication (IPC)

Arrays and Linked Lists

Introduction to OpenMP.

PRIMEHPC FX10: Advanced Software

Open Multi-Processing: Basic Course

CSE344 Final Exam Winter 2017

Basic Communication Operations (Chapter 4)

Introduction to OpenMP. OpenMP basics OpenMP directives, clauses, and library routines

Topics. Introduction. Shared Memory Parallelization. Example. Lecture 11. OpenMP Execution Model Fork-Join model 5/15/2012. Introduction OpenMP

Programming for Fujitsu Supercomputers

Parallel Computer Architecture and Programming Written Assignment 3

CS 231 Data Structures and Algorithms, Fall 2016

Programming II (CS300)

Indirect Communication

Chapter-6. SUBJECT:- Operating System TOPICS:- I/O Management. Created by : - Sanjay Patel

Evaluating the Portability of UPC to the Cell Broadband Engine

CS193k, Stanford Handout #10. HW2b ThreadBank

6.189 IAP Lecture 5. Parallel Programming Concepts. Dr. Rodric Rabbah, IBM IAP 2007 MIT

Processes and Threads. Processes: Review

GPU Programming. Parallel Patterns. Miaoqing Huang University of Arkansas 1 / 102

IT Best Practices Audit TCS offers a wide range of IT Best Practices Audit content covering 15 subjects and over 2200 topics, including:

ECE 454 Computer Systems Programming

A Message Passing Standard for MPP and Workstations

CS 160: Interactive Programming

CSE 307: Principles of Programming Languages

Alfio Lazzaro: Introduction to OpenMP

Thomas Jefferson Invitational Open in Informatics 2012

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective

Lecture 8. Linda and Erlang

Database Management Systems. Chapter 5

--Introduction to Culler et al. s Chapter 2, beginning 192 pages on software

Parallel Architectures

VS2010 C# Programming - DB intro 1

Communication and Optimization Aspects of Parallel Programming Models on Hybrid Architectures

Introduction OpenCL Code Exercices. OpenCL. Tópicos em Arquiteturas Paralelas. Peter Frank Perroni. November 25, 2015

HKTA TANG HIN MEMORIAL SECONDARY SCHOOL SECONDARY 3 COMPUTER LITERACY. Name: ( ) Class: Date: Databases and Microsoft Access

Transaction Management: Concurrency Control, part 2

Locking for B+ Trees. Transaction Management: Concurrency Control, part 2. Locking for B+ Trees (contd.) Locking vs. Latching

EGCI 321: Database Systems. Dr. Tanasanee Phienthrakul

CS143: Relational Model

Multi-core Architecture and Programming

Database Management Systems. Chapter 5

Innovations in Business Solutions. SAP Analytics, Data Modeling and Reporting Course

Lecture 5: Methods CS2301

Synchronisation in Java - Java Monitor

CS18000: Problem Solving And Object-Oriented Programming

THEATR An actor based language

basic db architectures & layouts

Seismic Code. Given echo data, compute under sea map Computation model

Information Systems (Informationssysteme)

CPSC 213, Winter 2013, Term 2 Final Exam Date: April 14, 2014; Instructor: Mike Feeley

DPHPC: Introduction to OpenMP Recitation session

CSE 160 Lecture 10. Instruction level parallelism (ILP) Vectorization

application 2 Wasp contains: behavior based algorithms in modeling multiagent systems

Question 1. Notes on the Exam. Today. Comp 104: Operating Systems Concepts 11/05/2015. Revision Lectures

MPI Lab. How to split a problem across multiple processors Broadcasting input to other nodes Using MPI_Reduce to accumulate partial sums

Chapter 5: Physical Database Design. Designing Physical Files

CS370 Operating Systems

Introduction to OpenMP

Last Class: Clock Synchronization. Today: More Canonical Problems

Recursive Problem Solving

Parallel Numerical Algorithms

SQL: Data Definition Language. csc343, Introduction to Databases Diane Horton Fall 2017

NDSeq: Runtime Checking for Nondeterministic Sequential Specs of Parallel Correctness

Spring 2016 Programming Languages Qualifying Exam

Two Phase Commit Protocol. Distributed Systems. Remote Procedure Calls (RPC) Network & Distributed Operating Systems. Network OS.

Advanced SQL. Nov 21, CS445 Pacific University 1

Today s Class. Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Formal Properties of Schedules. Conflicting Operations

Indirect Communication

Programmiersprachen (Programming Languages)

Review for Midterm 3/28/11. Administrative. Parts of Exam. Midterm Exam Monday, April 4. Midterm. Design Review. Final projects

Answer key SUBJECT : COMPUTER SCIENCE Time : 3 hour 15 min Max. marks : 70

DISTRIBUTED SYSTEMS [COMP9243] Lecture 3b: Distributed Shared Memory DISTRIBUTED SHARED MEMORY (DSM) DSM consists of two components:

Parallel Computing Parallel Programming Languages Hwansoo Han

Transcription:

Abstract Memory The TupleSpace Linda, JavaSpaces, Tspaces and PastSet

Tuple Space Main idea: Byte ordered memory is a product of hardware development, not programmers needs Remodel memory to support the application view on memory, i.e. more complex datastructures

Tuples A tuple is a vector representation of a data-structure Tuples are typically identified by a flag in the beginning of the tuple ( Student, Kurt,Bachelor,8.12); is an instance of a template ( Student,Name, Level, GPA)

TupleSpace ("Person", "John Doe", 21,6.5) ("Pi", 3.14) ("Color", Blue)

TupleSpaces Implementations Multitude of different implementations Linda JavaSpaces Tspaces PastSet Many more!

Linda First implementation of the TupleSpace Closely integrated with the target language C-Linda C++ Linda Fortran-Linda Ada-Linda

Linda Operations Out place a tuple in the TupleSpace In take a tuple from the TupleSpace Rd - a tuple-copy from the TupleSpace Eval place a new task in to TupleSpace

Linda Examples out( Person, Doe, John, 23, 82, BLUE); out( Person, Last_name, First_name, Age,\ Weight, Eye_color); in( Person,? Last_name,? First_name,? Age,\? Weight,? Eye_color); in( Person,? Last_name,? First_name, 32, \? Weight, GRAY);. in( Person,? Last_name,? First_name, 32, \? Weight, color);.

JavaSpaces SUN s approach to TupleSpace Works on generic objects rather than tuples Read and take are nonblocking! Tuples can grow old and die in JavaSpaces

JavaSpaces - Operations Write - writes an object into a JavaSpace Read - gets a copy of an object in a JavaSpace Take - retrieves an object from a JavaSpace Notify - attempts to notify an object that an object of a specified type has been written to the JavaSpace

Tspaces Tuple oriented version in Java Stronger semantics than JavaSpaces Tuples are somewhat hard to access Supports Preserialized objects Encurrages the use of many spaces

Tspaces Operations Write Read Take WaitToTake

PastSet PastSet should allow programmers to use shared memory techniques PastSet should provide memory consistency as a synchronization mechanism PastSet should provide debugging features similar to message-traces PastSet performance should be comparable to message-passing

PastSet Memory Model Tuples rather than bytes ( pi,(double)) Tuples with same template are stacked in an element Each element maintains sequential consistency Last-First < Last First 6 5 4 3 2 1 0

PastSet Memory Model 42,2,72 33,0.0 2,4.6 1,3.14 "Tabel",(int),(float) John Doe Betty Boo Popeye "Name",(string[255]) 1 0 0 0 1 "Taken",(bool)

PastSet Operations Enter get a handle for a tuple-template Mv place a tuple in the TupleSpace Ob read a tuple from the TupleSpace Unindexed; read the next previously unread tuple Indexed; read a specified tuple in the sequence Mob first Mv then Ob Last 6 5 4 3 First 2 1 0

PastSet Operations Spawn start a new task Axe allow PastSet to delete tuples that are smaller than or equal to the specified number DelElement remove an element from PastSet All of which are a necessity more than an integrated part of the idea

URMS User Redefinable Memory Semantics

A Simple URMS Example Global reduction, similar to MPI_Allreduce Worker 1... URMS cell (Global Sum[32]) Worker 32 Read Global Sum Read Global Sum Write Partiel Sum Write Partiel Sum

URMS Barrier implementation The URMS function simply collects n writes before making them visible b=enterdimension( My Barrier, NULL, BARRIER, n); Mob(b, NULL, b, NULL);

URMS Barrier Mob Mob Mob Mob Barrier Element

URMS Barrier Mob Mob Mob Mob Barrier Element

URMS Barrier Mob Mob Mob Mob Barrier Element

URMS Barrier Mob Mob Mob Mob Barrier Element

URMS Barrier Mob Mob Mob Mob Barrier Element

URMS Barrier Mob Mob Mob Mob Barrier Element

URMS Barrier Mob Mob Mob Mob Barrier Element

URMS in Java PastSet public interface URMSFunction extends Serializable { public Serializable filterin(element e, Serializable data); public int filterout(element e, Serializable data); } Reduce sum = new Reduce(n) { public Serializable operator(serializable a, Serializable b) { return new Integer(((Integer) a).intvalue() + ((Integer) b).intvalue()); } };

URMS for Parallel Processing A set of URMS functions can be taken directly from the group operations in MPI Sum, Product, Min, etc. Sorting data BLAS operations Fine grained parallelism queues can be optimized for data locality

URMS for Grid Remote Databases Many databases are huge and the users often wish to extract data that are hard to describe use db languages Either programmers need to transfer all data and filter locally Or the db site allows users to start threads at the db-server to filter locally Or URMS can make a best-of-both

Mapping a db-query to DSM SQL query PastSet db-library db-query 'cut-to-mem' Application Postgres

Data Distribution in PastSet Handled by a central element-server Central Server Round Robin First Touch

Latency Test observe(); //Observe the initial token get_start_time(); //Get timestamp for(i=0; i<1000; i++){ move(); //Send token to right neighbor observe(); //Get token from left neighbor } get_stop_time();

Latency Test

Ring test PastSet only

Ring test

Bandwidth Test get_start_time(); for(i=0; i<1000; i++) move(); //Write data-block to PastSet get_stop_time(); get_start_time(); for(i=0; i<1000; i++) observe(); //Read a data-block from PastSet get_stop_time();

Bandwidth Test

Lattice Gas Automaton

LGA Performance

Nbody n 2 complexity

Nbody Performance

Raytracer

Raytracer Performance

N-Queens Problem

N-Queens Problem Classic combinatoric problem similar to TSP The demonstrated solution is sub-optimal it can be improved by detection potential foldings and mirroring

N-Queen Sequential void make_boards(int i) { for(int y = 0 ; y < n ; y++){ all[i] = y ; if( legal(i) ) { if( i+1 == n ) count++; else make_boards(i+1); } } }

N-Queens Job type import java.io.*; class Job implements Serializable { int row; int [] pos; }

N-Queens Tspaces - Master ts=new TupleSpace("QUEENS","roadrunner00"); ts.write(new Tuple("Result", new Integer(0), new Integer(0))); Job job = new Job(); job.pos=new int[n]; job.row=0; for(int i=0;i<n;i++) job.pos[i]=0; template.add(new Field("Job")); template.add(new FieldPS(job));

N-Queens TSpaces Worker(){ try{ TupleSpace ts = new TupleSpace( QUEENS", roadrunner00 ); Tuple jobtemplate =new Tuple("Job",MANGLER); Tuple d=ts.waittotake(jobtemplate); job=((job)d.getfield(1).getvalue()); while(job!=null){ Queens(i); d=ts.take(jobtemplate); job=((job)d.getfield(1).getvalue()); } ts.write("result",new Integer(count)); } catch(tuplespaceexception tse) { } }

N-Queens TSpaces void make_boards(job job){ job.i++; for(int y = 0 ; y < n ; y++){ all[job.i] = y ; if( legal(job) ) { if(i<parallel_cut_off){ write_job(job); } else { if( i+1 == n ) count++; else make_boards(job.clone()); } } } }