Upload
irma-garrett
View
214
Download
0
Embed Size (px)
Citation preview
Chapter 3 Interacting with Distributed Arrays
Chung-Wei Chen, Department of Mathematics, National Taiwan University2011/10/28
Outline Introduction to Beamformer Algorithm of Beamformer Code of Beamformer How to Debug Performance Introduction to Parrallel Pipelines
Introduction to Beamformer Nb point sources Each source can emit waves of Nf different frequencies Wave emitting pattern are recorded at time t1, …, tNt
Introduction to BeamformerInteracting with Distributed Arrays4
t1 f1, …, fNf
t2
f1, …, fNf
tNt
f1, …, fNf
Source1 Source2SourceNb
f1, …, fNff1, …, fNff1, …, fNf
f1, …, fNf
Nt
Nb
Nf
Introduction to Beamformer There is a linear array of Ns sensors to detect the wave
emitting pattern
Introduction to BeamformerInteracting with Distributed Arrays5
Source1
Source2
SourceNb
Sensor1
Sensor1
SensorNs
Noise
SteeringVector
Step 1: run the program in serial on the local machine with the distributed arrays turned off
Step 2: run the program in serial on the local machine with the distributed arrays turned on
Step 3: run the program in parallel on the local machine Step 4: run the program in parallel on the remote
machine Step 5: run the program in parallel on the remote
machine but with a problem size of interest
How to DebugInteracting with Distributed Arrays16
How to Debug
How to Debug
How to DebugInteracting with Distributed Arrays17
Step 1: run the program in serial on the local machine with the distributed arrays turned off Set PARALLEL=0 Add the following line to the end of the m-file: whos X0 X1 X2 X3 X0loc X1loc X2loc x3
myI_f myV Type pBeamformer at the MATLAB prompt
This ensure the basic serial code is correct
Debug Step 2: run the program in serial on the local machine
with the distributed arrays turned on Set PARALLEL=1 Type eval(pRUN(‘pBeamformer’,1,{})) at the
MATLAB prompt This ensure the parallel code is correct
How to DebugInteracting with Distributed Arrays19
How to Debug Step 3: run the program in parallel on the local machine
Type eval(pRUN(‘pBeamformer’,4,{})) at the MATLAB prompt
Type !type MatMPI\*.out or !more MatMPI/*.out to show the output from the other MATLABs
This will detect errors introduced by communications
How to DebugInteracting with Distributed Arrays21
Step 4: run the program in parallel on the remote machine Type eval(pRUN(‘pBeamformer’,4,{‘machine1’ ‘machine2’})) at the MATLAB prompt
This will detect errors introduced by remote communications
Step 5: run the program in parallel on the remote machine but with a problem size of interest
How to DebugInteracting with Distributed Arrays23
How to Debug
Performance
PerformanceInteracting with Distributed Arrays25
Performance in the book
Performance of the machine Cambridge in City Cluster
Performance The loops of Stage 1 and 2 can be combined into one loop
PerformanceInteracting with Distributed Arrays26
Introduction to Parallel PipelinesInteracting with Distributed Arrays27
Introduction to Parallel Pipelines
Introduction to Parallel Pipelines
Introduction to Parallel PipelinesInteracting with Distributed Arrays28
Introduction to Parallel Pipelines
Introduction to Parallel PipelinesInteracting with Distributed Arrays29
Stage i Stage i+1
Original method
Parallel Piplines
Introduction to Parallel Pipelines
Introduction to Parallel PipelinesInteracting with Distributed Arrays30
Stage i Stage i+1