This work explores the automatic design-driven parallelization of divide-and-conquer algorithms, specifically focusing on sorting techniques. It evaluates key problems such as points-to analysis and region analysis, proposing solutions that solve subproblems in parallel. Examples include the recursive sorting of quarters of an array and merging techniques using temporary storage. The design aims to leverage concurrency to enhance computational efficiency and automate the process of designing parallel algorithms, ultimately achieving fully automatic implementations for complex sorting tasks.
An Image/Link below is provided (as is) to download presentation
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.Content is provided to you AS IS for your information and personal use only.Download presentation by click this link.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.During download, if you can't get a presentation, the file might be deleted by the publisher.
E N D
More Related Content
Presentation Transcript
Design-Driven Compilation Radu Rugina and Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology
Goal: Parallelization Computation + Fully Automatic Design Driven Overview Analysis Problems: Points-to Analysis, Region Analysis Two Potential Solutions Evaluation
Information Needed To Exploit Parallelism d and t point to different memory blocks Calls to sort access disjoint parts of d and t Together, calls access [d,d+n-1] and [t,t+n-1] sort(d,t,n/4); sort(d+n/4,t+n/4,n/4); sort(d+n/2,t+n/2,n/4); sort(d+3*(n/4),t+3*(n/4), n-3*(n/4)); d d+n-1 t t+n-1 d d+n-1 t t+n-1 d d+n-1 t t+n-1 d d+n-1 t t+n-1
Information Needed To Exploit Parallelism d and t point to different memory blocks First two calls to merge access disjoint parts of d,t Together, calls access [d,d+n-1] and [t,t+n-1] merge(d,d+n/4,d+n/2,t); merge(d+n/2,d+3*(n/4), d+n,t+n/2); merge(t,t+n/2,t+n,d); d d+n-1 t t+n-1 d d+n-1 t t+n-1 d d+n-1 t t+n-1
What Do You Need To Know To Exploit This Form of Parallelism? Points-to Information (d and t point to different data blocks) Symbolic Region Information (accessed regions within d and t blocks)
How Hard Is It To Figure These Things Out? void insertionSort(int *l, int *h) { int *p, *q, k; for (p = l+1; p < h; p++) { for (k = *p, q = p-1; l <= q && k < *q; q--) *(q+1) = *q; *(q+1) = k; } } Not immediately obvious that insertionSort(l,h) accesses [l,h-1]
How Hard Is It To Figure These Things Out? void merge(int *l1, int*m, int *h2, int *d) { int *h1 = m; int *l2 = m; while ((l1 < h1) && (l2 < h2)) if (*l1 < *l2) *d++ = *l1++; else *d++ = *l2++; while (l1 < h1) *d++ = *l1++; while (l2 < h2) *d++ = *l2++; } Not immediately obvious that merge(l,m,h,d) accesses [l,h-1] and [d,d+(h-l)-1]
Issues • Heavy Use of Pointers • Pointers into Middle of Arrays • Pointer Arithmetic • Pointer Comparison • Multiple Procedures • sort(int *d, int *t, n) • insertionSort(int *l, int *h) • merge(int *l, int *m, int *h, int *t) • Recursion
Fully Automatic Solution • Whole-program pointer analysis • Context-sensitive, flow-sensitive • Rugina and Rinard, PLDI 1999 • Whole-program region analysis • Symbolic constraint systems • Solve by reducing to linear programs • Rugina and Rinard, PLDI 2000
Key Complication Need for sophisticated interprocedural analyses • Pointer analysis • Propagate analysis results through call graph • Fixed-point algorithm for recursive programs • Region analysis • Formulation avoids fixed-point algorithms • Single constraint system for each strongly connected component • Need to have whole program in analyzable form
Bigger Picture • Points-to and region information is (implicitly) part of the interface of each procedure • Programmer understands procedure interfaces • Programmer knows • Points-to relationships on entry • Effect of procedure on points-to relationships • Regions of memory blocks that procedure accesses
Idea Enhance procedure interface to make points-to and region information explicit • Points-to language • Points-to graphs at entry and exit • Effect on points-to relationships • Region language • Symbolic specification of accessed regions • Programmer provides information • Analysis verifies that it is correct