Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chun-Yuan Lin MPI-Programming training-1. Broadcast Sending same message to all processes concerned with problem. Multicast - sending same message to.

Similar presentations


Presentation on theme: "Chun-Yuan Lin MPI-Programming training-1. Broadcast Sending same message to all processes concerned with problem. Multicast - sending same message to."— Presentation transcript:

1 Chun-Yuan Lin MPI-Programming training-1

2 Broadcast Sending same message to all processes concerned with problem. Multicast - sending same message to defined group of processes. bcast(); buf bcast(); data bcast(); data Process 0Processp - 1Process 1 Action Code MPI form root the broadcast action does not occur until all the processes have executed their broadcast routine. The broadcast operation will have the effect of synchronizing the processes.

3 Training A- Please declare an integer two-dimensional array with size 1000×1000 at the master processor. Case1: Write a MPI program with send and recv to do the broadcast. (least 4 processors) Case2: Using intrinsic broadcast function.

4 Scatter scatter(); buf scatter(); data scatter(); data Process 0Processp - 1Process 1 Action Code MPI form Sending each element of an array in root process to a separate process. Contents of ith location of array sent to ith process.

5 Training B Please declare an integer one-dimensional array with size 10,000 at the master processor. Case1: Write a MPI program with send and recv to do the scatter. (least 4 processors) Case2: Using intrinsic scatter function.

6 Gather gather(); buf gather(); data gather(); data Process 0Processp - 1Process 1 Action Code MPI form Having one process collect individual values from set of processes.

7 Training C Please declare an integer one-dimensional array with size 10,000 at the slave processors (least 4 processors). Case1: Write a MPI program with send and recv to do the gather. Case2: Using intrinsic gather function.

8 Please send the code of this training to my email this week (before 3/29, 23:59). Please annotate your name and your student ID in email. The source code file name is “student ID”. If more than one source code files, the names are “student ID-1”, “student ID-2”, etc. Please compress the files to a.zip or.rar file. The file name is “student ID-train1”. For example, a student has ID “A0000001” and two source code files. The source code file names are A0000001-1.c and A0000001- 2.c and the compressed file name is A0000001-train1.zip. The file will be rejected without following the rules.


Download ppt "Chun-Yuan Lin MPI-Programming training-1. Broadcast Sending same message to all processes concerned with problem. Multicast - sending same message to."

Similar presentations


Ads by Google