Download presentation
Presentation is loading. Please wait.
1
Collaboration of Parafrase-2 and NaraView
for Effective Parallelization Supports I am Masayo Haneda, student of Nara Women’s University in Japan. The topic of my presentation is “Collaboration of Parafrase-2 and NaraView for Effective Parallelization Supports”.
2
Background Purpose According to parallelizing compiler development,
necessity of parallelization support tools increases. We developed NaraView that visualizes program information as a parallelization support tool. Purpose Since we don’t have any perfect parallelizing compilers, the necessity of support tools increases. We have developed NaraView as a parallelization support tool. In this presentation, I’ll show how effective NaraView on program parallelization. Validation of NaraView as a parallelization support tool
3
Contents 1. NaraView 2. Validation Method 3. Result of Parallelization
My presentation will be in 5 parts. First, I’ll introduce NaraView briefly. Second, I’ll explain the way of validation about NaraView. Next, I’ll show results of parallelization for this validation. Then, I’ll compare results of parallelization for the validation. Finally, I’ll show our future work with small conclusion. 4. Validation 5. Conclusion
4
1. NaraView Visualize internal representations of
parallelizing compiler Parafrase-2 4 Types of View 1. Program Structure View 2. Source Code View 3. Hierarchical CFG View 4. Data Dependence View NaraView visualizes internal representation of parallelizing compiler, Parafrase-2. NaraView has 4 types of view. First view is Program Structure View. Second view is source code view. When we chose a cube on program structure view, Source code view shows the part of source code that corresponds it. Third view is hierarchical control flow graph. It describe two-dimentional flow graph of specified hierarchy. Fourth view is data dependence view. We parallelize our programs with these view. These views help us to understand the result of the operation that we applied. They provide interactive parallelization between users and a compiler
5
Parafrase-2 Parafrase-2 is a parallelizing compiler
that was developed in University of Illinois. Passfile: It specifies program analysis and optimization in the file Program Parafrase-2 Parafrase-2 is a parallelization compiler that was developed in CSRD. Parafrase-2 needs 2 input files. One is program file to describe a sequential program. Another is passfile to specify optimization methods for the parallelization. We obtain a parallel program from these two input file. The parallel program can be deferent, according to the passfile. Therefore, it is important that users have an effective strategy for parallelization. Parallelized Program User’s strategy decides execution efficiency
6
Program Structure View
This is a picture of Program Structure View. Program Structure View describes program on 3-dimentional tree structure. At first, I show meanings of axes. There are 3 axes on the view. This axis represents program flow, in this case, left side is a start point. This axis represents parallelizum. These cubes are located in parallel to this axis. They represent parallelized parts. This axis represents the depth of loop. Next, I show meanings of cubes. There are 4 kinds of cubes. Red cube represents loop, and cubes below the red cube are contents of loop. Blue cube and green cube represent expression. Data dependence exists in the expression correspond to blue cube,1 and don’t exist in the expression correspond to green cube. Yellow cube represents conditional expression. Loop Condition Expression Expression (concurrent)
7
Data Dependence View write access read access write & read access
This picture is data dependence view. Data dependence view correspond to the loop we choose in program structure view. In this view, xy-plane represents variables and z-axis represents program flow. Each cube corresponds to variables. Read cube means the existence of write access. Blue cube represents the existence of read access. Violet cube means the existence of both access on same variable. Green poll means data dependence. write & read access data dependence
8
2. Method of Validation Parallelize a real application with Parafrase-2 and NaraView in 3 distinguished ways Application Program Extended Huckel calculation program 3 Ways of Parallelization 1. Use only default passfile 2. Use a modified passfile 3. Use a modified passfile and hand optimize Next I explain the way of validation. We parallelized a real application with 3 methods. As a real application, we used Extended Huckel calculation program. Next I explain 3 methods. First is the parallelization with default passfile. Default passfile is attached in distributed package of Parafrase-2. Second is the parallelization with a modified passfile. We modify default passfile by using NaraView information. We use these 2 methods to compare the results of parallelization with NaraView and without NaraView. But, we obtained few difference between them. While passfile can specify optimizations arbitrarily, all of them don’t work completely. For the reason, we decided to one more experiment. It is the parallelization with hand optimization and modified passfile. This modified passfile and the file in second case are same. We optimize our program dynamically by using NaraView information. After these parallelization, I compared results of 3 methods. Finally, compare three results and validate them
9
Extended Huckel calculation program
Optimize molecular geometry parameters. It consists of 8 subroutines. clean.f sortds.f sortdk.f matrix.f matpr.f smplhk.f srtvdd.f hoqrv2.f Simple calculation Extended... is one of the chemical calculation to optimize molecular geometry parameters. It consists of 8 subroutines. We focus on main calculation since it takes 99% execution time. Main calculation
10
3. Result of Parallelization
Case1: Use only default passfile Result (Program Structure View) Next, I show the results of parallelization. As the first experiment we use only default passfile. After the parallelization, we obtain this picture. This is the program structure view. We can see some non-parallelized loops remaining. Some non-parallelized loops remain
11
To Eliminate Data Dependence
Add adequate code transformations into default passfile Code Transformation: modify internal representations to optimize program execution time How to decide adequate code transformations? Because data dependence prevents parallelization, we apply some optimizations to eliminate them. We can optimize our program by using transformation methods of Parafrase-2. We have to choose adequate transformation methods for our program. To chose them, we must observe data dependence and program in detail. In the next parallelization, we use NaraView to observe them. We use program structure view and data dependence view of it. They make the observation easy. Observe data dependencies in the program in detail Program structure view & data dependence view of NaraView are useful to observe them
12
Case2: Use a modified passfile
Example (line-13) DO j= k + 1, n w (j,1) = 0.d e (j) = a (k,j) s = e (j) * e (j) + s 16 non-parallelized loop (program structure view) Now, we move to second experiment. For this parallelization, we need to modify default passfile. As the example, I take the loop at line 13 of our program. Observe data dependence view corresponding this loop to parallelize
13
Add the two transformations into default passfile
This is the DDV. E is array, because the cubes are located in stairs. On array e, we have data dependence between two operations in the same iteration. To eliminate data dependence, it is necessary to divide 2 accesses into two different loops. Therefore Loop Distribution is adequate transformation for it. S is scalar, because the cubes are located in poll. If the poll turn to the stairs, data dependence will be eliminated. Therefore Scalar expansion is efficiency for it. Loop Distribution Scalar Expansion Add the two transformations into default passfile
14
Program Structure View
Result of Case2 As the result, we obtained the PSV picture. We gain 2 more parallelized loops. Program Structure View Two more loops are parallelized
15
Case3: Use a Modified Passfile and Hand Optimize
Example (line-21) DO 347 j = k + 1,n e(j) = a(k,j) cptmp_346(j) = e(j) * e(j) cptmp_346(j-1) 347CONTINUE We move to the result of third parallelization. At third experiment, we apply hand optimization to the result of second parallelization. We modify out program at the points that compiler couldn’t parallelize. Display corresponding data dependence view
16
Example of Modification (line-21)
DO 347 j = k + 1,n e(j) = a(k,j) cptmp_346(j) = e(j) * e(j) cptmp_346(j-1) 347CONTINUE DO 347 j = k + 1,n e(j) = a(k,j) 347 CONTINUE DO 390 j = k + 1,n cptmp_346(j) = e(j) * e(j) cptmp_346(j - 1) 26 390 CONTINUE Example of Modification (line-21) After modification, we obtain 2 new loops. We can parallelize these loop. After the modification, Parafrase-2 can parallelize this loop.
17
Result of Case3 Program Structure View
This is the picture of PSV that is a result of third parallelization. Program Structure View
18
4. Validation Parallelization process at line-13 Case1 Case2 Case3
Effectiveness of each method Next, I show the validation of previous results. These pictures are PSV of the loop at line-13. They show the process of parallelization. And this table shows the number of loop iterations. I assumed that iteration number of parallel loop is 1 iteration. The table indicate the declaration of loop iterations. Especially loop at line-69, we could reduce the number from polynomial(n2) to constant time. The Number of Loop Iterations
19
5. Conclusion Effectiveness of visualized program information
is indicated by these results Future Work It is difficult to decide adequate transformation for parallelization. As the conclusion, we can show the effectiveness of NaraView on program parallelization. In this experiment, we found some problem. By using NaraView, we can understand the process of parallelization, but it is difficult to use these information effectively. If there is a support tool to propose candidates of transformations on NaraView, user can select one from them. It is our future work to develop such a support tool. Propose candidates of transformation Select one from them with visualized program information
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.