Programming Multi-Core Processors based Embedded Systems A Hands-On Experience on Cavium Octeon based Platforms Lab Exercises.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Analysis of Algorithms CS 477/677 Linear Sorting Instructor: George Bebis ( Chapter 8 )
Non-Comparison Based Sorting
CAN IT BE CONSIDERED AN EFFECTIVE SORT METHOD? Answer maybe for small data sets but definitely not for large sets. Nevertheless it is stable.
Quick Sort, Shell Sort, Counting Sort, Radix Sort AND Bucket Sort
Quicksort Quicksort     29  9.
Lecture 8 – Collective Pattern Collectives Pattern Parallel Computing CIS 410/510 Department of Computer and Information Science.
Sorting Chapter 9.
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
Simulating a CRCW algorithm with an EREW algorithm Efficient Parallel Algorithms COMP308.
1 Merge and Quick Sort Quick Sort Reading p
Addressing Optimization for Loop Execution Targeting DSP with Auto-Increment/Decrement Architecture Wei-Kai Cheng Youn-Long Lin* Computer & Communications.
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
File System Structure §File structure l Logical storage unit l Collection of related information §File system resides on secondary storage (disks). §File.
MergeSort Source: Gibbs & Tamassia. 2 MergeSort MergeSort is a divide and conquer method of sorting.
Simulating a CRCW algorithm with an EREW algorithm Lecture 4 Efficient Parallel Algorithms COMP308.
1 Design and Analysis of Algorithms تصميم وتحليل الخوارزميات (311 عال) Chapter 1 Introduction to Algorithms.
Data Structure & Algorithm Lecture 7 – Linear Sort JJCAO Most materials are stolen from Prof. Yoram Moses’s course.
CSE 373 Data Structures Lecture 15
Programming Multi-Core Processors based Embedded Systems A Hands-On Experience on Cavium Octeon based Platforms Lab Exercises.
Introduction to Parallel Programming MapReduce Except where otherwise noted all portions of this work are Copyright (c) 2007 Google and are licensed under.
The Group Runtime Optimization for High-Performance Computing An Install-Time System for Automatic Generation of Optimized Parallel Sorting Algorithms.
Exercise problems for students taking the Programming Parallel Computers course. Janusz Kowalik Piotr Arlukowicz Tadeusz Puzniakowski Informatics Institute.
Microsoft Visual Basic 2008 CHAPTER NINE Using Arrays and File Handling.
Microsoft Visual Basic 2005 CHAPTER 9 Using Arrays and File Handling.
1 Interconnects Shared address space and message passing computers can be constructed by connecting processors and memory unit using a variety of interconnection.
Using Arrays and File Handling
1 Sorting in O(N) time CS302 Data Structures Section 10.4.
Adaptive Parallel Sorting Algorithms in STAPL Olga Tkachyshyn, Gabriel Tanase, Nancy M. Amato
Programming Multi-Core Processors based Embedded Systems A Hands-On Experience on Cavium Octeon based Platforms Lab Exercises.
Chapter 4 Storage Management (Memory Management).
CS 61B Data Structures and Programming Methodology July 28, 2008 David Sun.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Sorting. Pseudocode of Insertion Sort Insertion Sort To sort array A[0..n-1], sort A[0..n-2] recursively and then insert A[n-1] in its proper place among.
ANALYSIS AND IMPLEMENTATION OF GRAPH COLORING ALGORITHMS FOR REGISTER ALLOCATION By, Sumeeth K. C Vasanth K.
Programming Multi-Core Processors based Embedded Systems A Hands-On Experience on Cavium Octeon based Platforms Lab Exercises (Lab 2: Sorting)
1 Sorting. 2 Introduction Why is it important Where to use it.
Programming Multi-Core Processors based Embedded Systems A Hands-On Experience on Cavium Octeon based Platforms Lab Exercises: Lab 5 (Deep Packet Inspection)
Motivation: Sorting is among the fundamental problems of computer science. Sorting of different datasets is present in most applications, ranging from.
UNIT 5.  The related activities of sorting, searching and merging are central to many computer applications.  Sorting and merging provide us with a.
1 Radix Sort. 2 Classification of Sorting algorithms Sorting algorithms are often classified using different metrics:  Computational complexity: classification.
RT-LAB Electrical Applications 1 Opal-RT Technologies Use of the “Store Embedded” mode Solution RT-LAB for PC-104.
COSC 3101A - Design and Analysis of Algorithms 6 Lower Bounds for Sorting Counting / Radix / Bucket Sort Many of these slides are taken from Monica Nicolescu,
1 Ch.19 Divide and Conquer. 2 BIRD’S-EYE VIEW Divide and conquer algorithms Decompose a problem instance into several smaller independent instances May.
BMTRY 789 Lecture 6: Proc Sort, Random Number Generators, and Do Loops Readings – Chapters 5 & 6 Lab Problem - Brain Teaser Homework Due – HW 2 Homework.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Fragmentation External Fragmentation – total memory space exists to satisfy.
PROGRAMMING 1 – HELPER INSTRUCTIONS ACKNOWLEDGEMENT: THE SLIDES ARE PREPARED FROM SLIDES PROVIDED BY NANCY M. AMATO AND JORY DENNY 1.
Programming Multi-Core Processors based Embedded Systems A Hands-On Experience on Cavium Octeon based Platforms Lab Exercises: Lab 4 (Network Packet Filtering)
Programming Multi-Core Processors based Embedded Systems A Hands-On Experience on Cavium Octeon based Platforms Lab Exercises: Lab 1 (Performance measurement)
Software. Introduction n A computer can’t do anything without a program of instructions. n A program is a set of instructions a computer carries out.
COMP7330/7336 Advanced Parallel and Distributed Computing Task Partitioning Dynamic Mapping Dr. Xiao Qin Auburn University
1 Algorithms Searching and Sorting Algorithm Efficiency.
Chapter 7: Main Memory CS 170, Fall Program Execution & Memory Management Program execution Swapping Contiguous Memory Allocation Paging Structure.
Chapter 9: Data types and data structures OCR Computing for A Level © Hodder Education 2009.
Embedded Systems MPSoC Architectures OpenMP: Exercises Alberto Bosio
Advanced Sorting 7 2  9 4   2   4   7
Chapter 11 Sorting Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich, Tamassia and Mount.
Sorting.
Programming Multi-Core Processors based Embedded Systems A Hands-On Experience on Cavium Octeon based Platforms Lab Exercises.
File System Implementation
MergeSort Source: Gibbs & Tamassia.
Linear Sorting Sections 10.4
Objective of This Course
MSIS 655 Advanced Business Applications Programming
A function f is increasing on an open interval I if, for any choice of x1 and x2 in I, with x1 < x2, we have f(x1) < f(x2). A function f is decreasing.
Lecture 3: Main Memory.
Quick-Sort 2/25/2019 2:22 AM Quick-Sort     2
Quick-Sort 4/8/ :20 AM Quick-Sort     2 9  9
CS203 Lecture 15.
Parallel Programming with ForkJoinPool Tasks in Java
Presentation transcript:

Programming Multi-Core Processors based Embedded Systems A Hands-On Experience on Cavium Octeon based Platforms Lab Exercises

2-2 Lab # 2: Parallel Sort using MPAC

2-3 Lab 2 – Parallel Sorting Objectives To implement two parallel sorting algorithm Quick sort Bucket Sort Mechanism Generate an user defined array of random values Partition the data array using user specified algorithm Worker threads sorts the partitioned array Merge the partitioned arrays Performance measurements

2-4 Parallel Quick Sort The data array is partitioned into N arrays of equal length, where N = No. of threads Each partitioned array is passed to a different thread Each thread sorts its respective array All sorted partitioned arrays are passed to main thread where they are merged together The merged array is sorted

2-5 Parallel Quick Sort Thread Function (1) (2) (3) (4)

2-6 Cross Compile for Target System Cross Compile on Host System Go to Cavium SDK directory and run the command host$ source env-setup (where is the model of your target board. E.g. OCTEON_CN56XX) host$ cd / /mpac_1.2 host$./configure --host=i386-redhat-linux-gnu --target=mips64-octeon-linux-gnu export CC=mips64-octeon-linux-gnu-gcc host$ make clean host$ make CC=mips64-octeon-linux-gnu-gcc

2-7 Run on target system Copy executable “mpac_sort_app” on target system target $./mpac_sort_app –n –s -u q For Help target$./mpac_sort_app –h

2-8 Parallel Bucket Sort Minimum and Maximum values are identified from the data array Range of data is identified (maximum –minimum) N buckets of equal intervals are formed, where N is no. of threads The interval length is calculated by (maximum – minimum)/no. of threads The first bucket starts with the minimum value and the last bucket ends with maximum value

2-9 Parallel Bucket Sort (cont…) A bucket is a dynamically allocated array Each element of the data array is stored in its corresponding bucket (the interval in which the data lies) After all elements are copied in the buckets, each bucket is sent to an individual thread Each thread sorts its respective array All sorted partitioned arrays are passed to main thread where they are merged together This merged array will be a sorted array

2-10 Parallel Bucket Sort Thread Function (1) (2) (3) (4)

2-11 Cross Compile for Target System Cross Compile on Host System Go to Cavium SDK directory and run the command host$ source env-setup (where is the model of your target board. E.g. OCTEON_CN56XX) host$ cd / /mpac_1.2 host$./configure --host=i386-redhat-linux-gnu --target=mips64-octeon-linux-gnu export CC=mips64-octeon-linux-gnu-gcc host$ make clean host$ make CC=mips64-octeon-linux-gnu-gcc

2-12 Run on target system Copy executable “mpac_sort_app” on target system target $./mpac_sort_app –n –s -u b For Help target$./mpac_sort_app –h

2-13 Performance Measurement Observations Observe the decreasing elapsed time indicating increase in performance with increasing number of threads Bucker Sort is more efficient than Quick Sort algorithm (a) Bucket Sort(a) Quick Sort $./mpac_sort_app –n –s –u b –a 1 $./mpac_sort_app –n –s –u q –a 1