# Chapter 3 Interacting with Distributed Arrays Chung-Wei Chen, Department of Mathematics, National Taiwan University 2011/10/28.

## Presentation on theme: "Chapter 3 Interacting with Distributed Arrays Chung-Wei Chen, Department of Mathematics, National Taiwan University 2011/10/28."— Presentation transcript:

Chapter 3 Interacting with Distributed Arrays Chung-Wei Chen, Department of Mathematics, National Taiwan University 2011/10/28

Outline  Introduction to Beamformer  Algorithm of Beamformer  Code of Beamformer  How to Debug  Performance  Introduction to Parrallel Pipelines

Introduction to BeamformerInteracting with Distributed Arrays3 Introduction to Beamformer

 N b point sources  Each source can emit waves of N f different frequencies  Wave emitting pattern are recorded at time t 1, …, t Nt Introduction to BeamformerInteracting with Distributed Arrays4 t1t1 f 1, …, f Nf t2t2 t Nt f 1, …, f Nf Source 1 Source 2 Source Nb f 1, …, f Nf NtNt NbNb NfNf

Introduction to Beamformer  There is a linear array of N s sensors to detect the wave emitting pattern Introduction to BeamformerInteracting with Distributed Arrays5 Source 1 Source 2 Source Nb Sensor 1 Sensor Ns Noise Steering Vector

Algorithm of BeamformerInteracting with Distributed Arrays6 Algorithm of Beamformer

 Serial: Algorithm of BeamformerInteracting with Distributed Arrays7

Algorithm of Beamformer  Parallel: Algorithm of BeamformerInteracting with Distributed Arrays8

Algorithm of Beamformer Interacting with Distributed Arrays9

Algorithm of Beamformer Interacting with Distributed Arrays10

Code of BeamformerInteracting with Distributed Arrays11 Code of Beamformer

Code of Beamformer (1/3) Code of BeamformerInteracting with Distributed Arrays12

Code of Beamformer (2/3) Code of BeamformerInteracting with Distributed Arrays13

Code of Beamformer (3/3) Code of BeamformerInteracting with Distributed Arrays14

How to DebugInteracting with Distributed Arrays15 How to Debug

 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

Interacting 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

How to DebugInteracting with Distributed Arrays18 How to Debug

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 Interacting with Distributed Arrays20

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

How to DebugInteracting with Distributed Arrays22 How to Debug

 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

PerformanceInteracting with Distributed Arrays24 Performance

Interacting 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

Interacting with Distributed Arrays28

Introduction to Parallel Pipelines Interacting with Distributed Arrays29 Stage iStage i+1  Original method

 Parallel Piplines Introduction to Parallel Pipelines Interacting with Distributed Arrays30 Stage iStage i+1

Reference Interacting with Distributed Arrays31  “Parallel MATLAB for Multicore and Multinode Systems” by Jeremy Kepner, SIAM Press, 2009 Thanks for your attention!

Download ppt "Chapter 3 Interacting with Distributed Arrays Chung-Wei Chen, Department of Mathematics, National Taiwan University 2011/10/28."

Similar presentations