Hill Climbing In a Banking Application (PThreads Version) -by Nitin Agarwal Kailash Aurangabadkar Prashant Jain Rashmi Kankaria Nan Zhang.

Slides:



Advertisements
Similar presentations
Parallel Processing with OpenMP
Advertisements

Introduction to Openmp & openACC
Distributed Systems CS
Random Testing Tor Stålhane Jonas G. Brustad. What is random testing The principle of random testing is simple and can be described as follows: 1.For.
N-Body Simulation Michael Mersic CS680.
Introductions to Parallel Programming Using OpenMP
Parallel Programming Motivation and terminology – from ACM/IEEE 2013 curricula.
8a-1 Programming with Shared Memory Threads Accessing shared data Critical sections ITCS4145/5145, Parallel Programming B. Wilkinson Jan 4, 2013 slides8a.ppt.
Threads. What do we have so far The basic unit of CPU utilization is a process. To run a program (a sequence of code), create a process. Processes are.
A PARALLEL GENETIC ALGORITHM FOR SOLVING THE SCHOOL TIME TABLING PROBLEM SUMALATHA.
1 GRAPHS IN ECONOMICS APPENDIX.
Generated Waypoint Efficiency: The efficiency considered here is defined as follows: As can be seen from the graph, for the obstruction radius values (200,
1 Distributed Computing Algorithms CSCI Distributed Computing: everything not centralized many processors.
1 Tuesday, November 07, 2006 “If anything can go wrong, it will.” -Murphy’s Law.
DISTRIBUTED AND HIGH-PERFORMANCE COMPUTING CHAPTER 7: SHARED MEMORY PARALLEL PROGRAMMING.
1 Distributed Dynamic Partial Order Reduction based Verification of Threaded Software Yu Yang (PhD student; summer intern at CBL) Xiaofang Chen (PhD student;
A New Evolutionary Algorithm for Multi-objective Optimization Problems Multi-objective Optimization Problems (MOP) –Definition –NP hard By Zhi Wei.
© 2010 Pearson Education Canada. A graph reveals a relationship. A graph represents “quantity” as a distance. A two-variable graph uses two perpendicular.
CSE5304—Project Proposal Parallel Matrix Multiplication Tian Mi.
Chapter 8 – Normal Probability Distribution A probability distribution in which the random variable is continuous is a continuous probability distribution.
Server Architecture Models Operating Systems Hebrew University Spring 2004.
On the Task Assignment Problem : Two New Efficient Heuristic Algorithms.
Accelerating Machine Learning Applications on Graphics Processors Narayanan Sundaram and Bryan Catanzaro Presented by Narayanan Sundaram.
Optimization Methods One-Dimensional Unconstrained Optimization
Given UPC algorithm – Cyclic Distribution Simple algorithm does cyclic distribution This means that data is not local unless item weight is a multiple.
10/04/2011CS4961 CS4961 Parallel Programming Lecture 12: Advanced Synchronization (Pthreads) Mary Hall October 4, 2011.
Computer Science 320 Measuring Speedup. What Is Running Time? T(N, K) says that the running time T is a function of the problem size N and the number.
Exercise problems for students taking the Programming Parallel Computers course. Janusz Kowalik Piotr Arlukowicz Tadeusz Puzniakowski Informatics Institute.
Parallel implementation of RAndom SAmple Consensus (RANSAC) Adarsh Kowdle.
L15: Putting it together: N-body (Ch. 6) October 30, 2012.
Copyright © 2006 Pearson Education Canada Appendix: Graphs in Economics PART 1Introduction 1 CHAPTER.
1 Interconnects Shared address space and message passing computers can be constructed by connecting processors and memory unit using a variety of interconnection.
Lappeenranta University of Technology / JP CT30A7001 Concurrent and Parallel Computing Introduction to concurrent and parallel computing.
Parallel and Distributed Simulation Hardware Platforms Simulation Fundamentals.
1 APPENDIX Graphs in Economics.
© 2010 Pearson Addison-Wesley. Graphing Data A graph reveals a relationship. A graph represents “quantity” as a distance. A two-variable graph uses.
Access Path Selection in a Relational Database Management System Selinger et al.
Finding Roots Composite Numbers STEP 1: Find all the factors of a number.
The University of Adelaide, School of Computer Science
Portable Operating System Interface Thread Yukai Hung Department of Mathematics National Taiwan University Yukai Hung
04/10/25Parallel and Distributed Programming1 Shared-memory Parallel Programming Taura Lab M1 Yuuki Horita.
Sieve of Eratosthenes by Fola Olagbemi. Outline What is the sieve of Eratosthenes? Algorithm used Parallelizing the algorithm Data decomposition options.
CSCI-455/552 Introduction to High Performance Computing Lecture 19.
Scaling Area Under a Curve. Why do parallelism? Speedup – solve a problem faster. Accuracy – solve a problem better. Scaling – solve a bigger problem.
Parallel graph algorithms Antonio-Gabriel Sturzu, SCPD Adela Diana Almasi, SCPD Adela Diana Almasi, SCPD Iulia Alexandra Floroiu, ISI Iulia Alexandra Floroiu,
Parallelization of likelihood functions for data analysis Alfio Lazzaro CERN openlab Forum on Concurrent Programming Models and Frameworks.
Introduction to OpenMP Eric Aubanel Advanced Computational Research Laboratory Faculty of Computer Science, UNB Fredericton, New Brunswick.
Pthreads: A shared memory programming model
Executing Parallel Programs with Potential Bottlenecks Efficiently Yoshihiro Oyama Kenjiro Taura Akinori Yonezawa {oyama, tau,
CS- 492 : Distributed system & Parallel Processing Lecture 7: Sun: 15/5/1435 Foundations of designing parallel algorithms and shared memory models Lecturer/
Radix Sort and Hash-Join for Vector Computers Ripal Nathuji 6.893: Advanced VLSI Computer Architecture 10/12/00.
Operating Systems Inter-Process Communications. Lunch time in the Philosophy Department. Dining Philosophers Problem (1)
Rounding scheme if r * j  1 then r j := 1  When the number of processors assigned in the continuous solution is between 0 and 1 for each task, the speed.
Patterns and Relationships
CS 360 pthreads Condition Variables for threads. Page 2 CS 360, WSU Vancouver What is the issue? Creating a thread to perform a task and then joining.
Contribution: Timing then Mario Luigi Biochemical rules are inherently parallel. Sequentialize? Step 1: Step 2:
Concurrency and Performance Based on slides by Henri Casanova.
A New Class of Mobility Models for Ad Hoc Wireless Networks Rahul Amin Advisor: Dr. Carl Baum Clemson University SURE 2006.
Factoring Greatest Common Factor. Factoring We are going to start factoring today. I will take it easy on you in the beginning. Factoring is one skill.
Multi-Grid Esteban Pauli 4/25/06. Overview Problem Description Problem Description Implementation Implementation –Shared Memory –Distributed Memory –Other.
1 Programming with Shared Memory - 2 Issues with sharing data ITCS 4145 Parallel Programming B. Wilkinson Jan 22, _Prog_Shared_Memory_II.ppt.
COMP7330/7336 Advanced Parallel and Distributed Computing Pthread RW Locks – An Application Dr. Xiao Qin Auburn University
EXCEL: Multiple Regression
Homework Assignment #2 J. H. Wang Oct. 25, 2016.
Pthreads – Create and Join
Homework Assignment #2 J. H. Wang Oct. 24, 2017.
Chapter 3: Principles of Scalable Performance
Programming with Shared Memory
Sample vs Population comparing mean and standard deviations
Programming with Shared Memory - 2 Issues with sharing data
Presentation transcript:

Hill Climbing In a Banking Application (PThreads Version) -by Nitin Agarwal Kailash Aurangabadkar Prashant Jain Rashmi Kankaria Nan Zhang

 Problem Description Find a way to distribute k lockboxes amongst n locations so as to get minimum float. We are parallelizing this problem because :- For a large value of n and k, the sequential algorithm works slow and its easy to parallelize the problem using hill climbing algorithm.

 Sequential Algorithm For m Start Points { Generate a start siting pattern Compute float for the initial siting pattern For each lockbox j { For Each Not Used Place s { Change the Jth position in the siting pattern with city s Calculate the float of the new siting pattern If float of new pattern < float of original pattern Save New Pattern and Float }

 Parallel Approach Used The parallel approach to this is direct. We divide the m different starting points among m threads and let them each reach their peak. We then take the least value of float and siting pattern from them as our result.

PThread Used Declaring the thread variable pthread_t thread[no_threads] Creating the threads for(i=0;i<no_threads;i++) pthread_create(&thread[i],NULL,slave,NULL) Mutex Lock Used Declaring Lock Variable pthread_mutex_t mutex1 Initializing the Lock pthread_mutex_init(&mutex1,NULL)

Pthreads Contd. Mutex Locks Used Locking and Unlocking pthread_mutex_lock(&mutex1) …….. pthread_mutex_unlock(&mutex1) Joining the threads for(i=0;i<no_threads;i++) pthread_join(thread[i],NULL)

Example Here is an example of how the program works. We start with 20 cities and 5 lockboxes and use 3 threads (starting points). The float values of the 20 cities are given below:

Example Contd. Each thread will generate its start siting pattern using a random number generator. Start Siting Pattern for Thread 1: Starting Float Value for Thread 1: 125 Start Siting Pattern for Thread 2: Starting Float Value for Thread 2: 250 Start Siting Pattern for Thread 3: Starting Float Value for Thread 3: 187 Each thread will then try to reach its own minimum float and the minimum of all three would be produced as the output. The minimum float as given by the program is: 53 The siting pattern that produces the given float:

 Speed-Up Vs # Processors To get this curve the problem size was fixed at Number of Cities = 1000 Number of Lockboxes = 5 and the number of threads were varied from 2 to 8. Each thread starts with its own random siting pattern.

Values #ProcessorsParallel TimeSerial TimeSpeedup

Chart

Results Values of n, k and mSequentialParallelSpeed-Up When # cities is increased and # threads is kept constant

Observations Pthreads works better than both MPI and PVM and works almost the same as openMP. Better Performance due to lesser communication costs. Mutex locks slow down the system but cant be done without since we’re using shared variables.

Questions??