Auto Parallelizing Option - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Auto Parallelizing Option

Description:

The Auto-Parallelizing option is an optional compiler phase that automatically ... Search for 'apo' Several documents will be listed for C, C , Fortran90, ... – PowerPoint PPT presentation

Number of Views:15
Avg rating:3.0/5.0
Slides: 13
Provided by: math56
Category:

less

Transcript and Presenter's Notes

Title: Auto Parallelizing Option


1
Auto Parallelizing Option
  • A Simple Introduction

2
What Is APO?
  • The Auto-Parallelizing option is an optional
    compiler phase that automatically analyzes and
    attempts to parallelize loops and loop nestings
  • Using data dependency analysis, DO or FOR loop
    nestings are examines and directives and pragmas
    are automatically inserted where it is determined
    safe and (hopefully) effective to do so.

3
APO Usage
  • f77 apo listkeep source.f
  • cc apo list source.c
  • APO optionally generates intermediate files
  • file_name.list diagnostic messages (if
    listkeep option)
  • file_name.m transformed source file (if keep
    option)
  • Before running program, specify the number of
    parallel threads
  • setenv MP_SET_NUMTHREADS 4

4
Using APO an Example
  • Source Code
  • subroutine mat(x,y,z,m)
  • real(kind8), dimension(m,m) x, y, z
  • integer m
  • do k 1,m
  • do j 1,m
  • do i 1,m
  • z(i,j) z(i,j) x(i,j) y(j,k)
  • end do
  • end do
  • end do
  • return
  • end

5
Using APO An Example (cont.)
  • Invoke APO
  • f90 apo keep O3 matmul90.f o matmul90
  • Contents of matmul90.list File
  • Parallelization Log of Subprogram mat_
  • 5 PARALLEL (Auto) _mpdo_mat_1
  • 4 Not Parallel
  • Loop is contained within a parallel construct
  • 6 Not Parallel
  • Loop is contained within a parallel construct

6
Performance on 300 MHz Origin
  • Using n1000, on the SGI Origin 2000 (at HPCC)
    with
  • optimization level 3.
  • PROGRAM SECONDS MFLOPS
  • 1 PROCESSOR MATMUL90 3.6169 276.5
  • 4 PROCESSORS MATMUL90 .9835 1016.7
  • 8 PROCESSORS MATMUL90 .5287 1891.4
  • 16 PROCESSORS MATMUL90 .3253 3073.8

7
Rule of thumb in APO
  • Parallel loop should be outermost nesting.
  • Dimension arrays with parallel dimensionrightmost
    (FORTRAN) or leftmost(C).
  • Decide on best parallel dimension, considering
    number of iterations, data dependencies, etc.

8
Question
  • In the source below (same as before), which loop
    should be the outermost and paralleled?
  • subroutine mat(x,y,z,m)
  • real(kind8), dimension(m,m) x, y, z
  • integer m
  • do k 1,m
  • do j 1,m
  • do i 1,m
  • z(i,j) z(i,j) x(i,j) y(j,k)
  • end do
  • end do
  • end do
  • return
  • end

9
Guidelines for Using APO
  • Profile code to identify hot spots
  • Run key subroutines through APO
  • Examine .list and .m files
  • If results look promising, test performance and
    correctness of APO transformations and quit if
    happy
  • Tune using APO directives

10
Note about APO Directives
  • You can manually insert APO directives to force
    parallelization the way you want . . .
  • HOWEVER, once youre resorting to directives to
    try to get APO to do what you want, you might as
    well bypass APO and use MP/OMP directives which
    well learn later.

11
Reference on APO
  • Man Pages (on Pleione)
  • man apo
  • Internet Resource
  • http//techpubs.sgi.com
  • Search for apo Several documents will be
    listed for C, C, Fortran90, Fortran77, etc.

12
THE END
Write a Comment
User Comments (0)
About PowerShow.com