Docsity

Performance Debugging Shared Memory Multiprocessor Programs - Notes | CMSC 714, Study notes of Computer Science

Toggle sidebar
bg1
1
Performance Debugging Shared
Memory Multiprocessor
Programs with MTOOL
A. Goldberg, J. Hennessy
Presented by Sam Angiuoli
What is MTOOL?
๎š„Performance profiler
๎š‰Shared memory bottlenecks, synchronization
overhead, parallelization overhead
๎š‰At least 2 profiled executions required
๎š„Supported platforms
๎š‰MIPS based architectures (+ others?)
๎š„SGI 380 (8x33 MHz processors and 256M shared mem)
๎š‰C + ANL macros
๎š‰Fortran with loop level parallelism
Overview of paper
๎š„Instrumentation
๎š‰Timers
๎š‰Basic block counters
๎š„Efforts to minimize instrumentation overhead
๎š„Description of memory/synchronization
bottlenecks
๎š„2 case studies
Timers
๎š„start_timer/stop_timer added to begin/end of
procedures
๎š„Bloat is minimized by scanning initial
execution profile to exclude fast/frequently
executed regions
๎š‰Minimum of 5x the overhead of start/stop timer
๎š„Alternative to timers is pc-sampling
Basic block
๎š„A sequence of one or more consecutive,
executable statements containing no
branches i=0; i<10
F(i) != 0
x=1/F(i) x=0
i=i++;i<10
return
T
TF
F
F
for(i=0;i<10;i++)
{if(f(i) != 0)
x=1/f(i);
else
x=0;
}
Minimum Cost Basic Block Counting
๎š„Minimize overhead while collecting block
counts during program execution
๎š„Only place counters on independent control
paths
๎š‰Derive dependent counts during post processing
๎š‰Eg: Donโ€™t count both blocks of if/then/else
๎š„Use loop counters to avoid counting each
iteration
pf3

Partial preview of the text

Download Performance Debugging Shared Memory Multiprocessor Programs - Notes | CMSC 714 and more Study notes Computer Science in PDF only on Docsity!

Performance Debugging Shared

Memory Multiprocessor

Programs with MTOOL

A. Goldberg, J. Hennessy

Presented by Sam Angiuoli

What is MTOOL?

ย„ Performance profiler

ย‰ Shared memory bottlenecks, synchronization

overhead, parallelization overhead

ย‰ At least 2 profiled executions required

ย„ Supported platforms

ย‰ MIPS based architectures (+ others?)

ย„ SGI 380 (8x33 MHz processors and 256M shared mem)

ย‰ C + ANL macros

ย‰ Fortran with loop level parallelism

Overview of paper

ย„ Instrumentation

ย‰ Timers

ย‰ Basic block counters

ย„ Efforts to minimize instrumentation overhead

ย„ Description of memory/synchronization

bottlenecks

ย„ 2 case studies

Timers

ย„ start_timer/stop_timer added to begin/end of

procedures

ย„ Bloat is minimized by scanning initial

execution profile to exclude fast/frequently

executed regions

ย‰ Minimum of 5x the overhead of start/stop timer

ย„ Alternative to timers is pc-sampling

Basic block

ย„ A sequence of one or more consecutive,

executable statements containing no

branches

i=0; i<

F(i) != 0

x=1/F(i) (^) x=

i=i++;i<

return

T

T F

F

F

for(i=0;i<10;i++) { if(f(i) != 0) x=1/f(i); else x=0; }

Minimum Cost Basic Block Counting

ย„ Minimize overhead while collecting block

counts during program execution

ย„ Only place counters on independent control

paths

ย‰ Derive dependent counts during post processing

ย‰ Eg: Donโ€™t count both blocks of if/then/else

ย„ Use loop counters to avoid counting each

iteration

Basic block counting

ย„ Capture block counts

during initial execution

ย‰ Counting cost 379

ย„ Eliminate edges on

maximal path

ย„ {(a,b),(b,d),(e,b),(a,f)}

ย‰ Counting cost 125

ย„ Examine loop variables

ย„ {(a,b),(e,f)}

ย‰ Counting cost 4

Memory bottlenecks

ย„ Identify bottlenecks by comparing actual

execution time to an estimated execution

time that assumes optimal memory access

ย„ Use initial profile run to select target regions

ย‰ Contain large amount of global memory access

ย‰ Low timer overhead

ย‰ Reasonable number of lines of code

Estimating optimal memory

ย„ Estimated compute time for basic block *

basic block count

ย„ RISC architecture allows for estimation of

compute time except in

ย„ Data dependent stalls

ย‰ Memory accesses

ย„ Stalls between instructions

Synchronization bottlenecks

ย„ Overhead is any time spent idle/spin-waiting

ย‰ Low perturbation timers used

ย„ Bottlenecks examined

ย‰ Load imbalance

ย„ Waiting at barrier

ย‰ Critical sections

ย„ Lock contention

ย‰ Starvation

ย„ Sequential executions in master process

ย„ User defined locks are ignored but can be specified

in a config file

Case study 1

ย„ Significant memory bottleneck

ย„ Suspect subroutine contains pointer swap that is

replaced with a copy to take advantage of cache

ย‰ ร†50% decrease in memory overhead

Case study 2

ย„ Shared vector ( Ready)

used to synchronize

processes exchanging

computed values

ย„ Non-linear speedup

indicates a bottleneck