Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using MPI on Dept. Clusters Min LI Sep 9 2010. Outline Run MPI programs on single machine Run mpi programs on multiple machines Assignment 1.

Similar presentations


Presentation on theme: "Using MPI on Dept. Clusters Min LI Sep 9 2010. Outline Run MPI programs on single machine Run mpi programs on multiple machines Assignment 1."— Presentation transcript:

1 Using MPI on Dept. Clusters Min LI Sep 9 2010

2 Outline Run MPI programs on single machine Run mpi programs on multiple machines Assignment 1

3 Login and info Login, putty – rlogin.cs.vt.edu a CS department account – https://admin.cs.vt.edu/https://admin.cs.vt.edu/ Info – People.cs.vt.edu/~limin/cs4234

4 Exercise 1 "Hello World" (30’) Task 1: Executing a simple Hello World program. – Mpicc –o hello hello.c – Mpiexec –n 4./hello message from process= 0: hello, world message from process= 1: hello, world message from process= 2: hello, world message from process= 3: hello, world Task 2 Modification so that master prints out all messages Master: Hello slaves give me your messages Message received from process 1 : Hello back Message received from process 2 : Hello back Message received from process 3 : Hello back

5 Ex1 continue Task 3: Different messages from each process Master: Hello slaves give me your messages Message received from process 1 : Hello, I am John Message received from process 2 : Hello, I am Mary Message received from process 3 : Hello, I am Susan Task 4: Experiments with tags – Modify the program from task 3 so that the master process sends a messages to each slave, but with the tag of 100 and the slave waits for message with a tag of 100. Confirm program works. – Repeat but make the slaves wait for tag 101, and check program hangs. Why?

6 Exercise 2 running on multiple machines(30’) Task 1: Setting up the list of machines to use mpiexec -hostfile machines -n 4 a.out – Creating a hostfile. gen_hostfile “filename”

7 SSh without passwords  run on any machines without typing passwords. ssh-keygen -t rsa -N "" The result : Generating public/private dsa key pair. Enter file in which to save the key (/home/ugrads/NAME/.ssh/id_dsa): Your identification has been saved in /home/ugrads/NAME/.ssh/id_dsa. Your public key has been saved in /home/ugrads/NAME/.ssh/id_dsa.pub. The key fingerprint is: 89:ff:00:5f:06:fd:d0:a2:9e:51:b1:00:cd:0a:76:6f NAME@MachineName.cslab cd.ssh cat id_dsa.pub >> authorized_keys

8 Ex2 continue Task2. running a simple job – mpirun -machinefile machines -n 5 hello Task3. identifying machine names message from locke.rlogin process= 1: hello, world, message from cyan.rlogin process= 2: hello, world, message from terra.rlogin process= 0: hello, world, message from shadow.rlogin process= 3: hello, world, Task4 Measuring time of execution – MPI_Wtime() – Experiment with running the program on one computer and on multiple computers. Does it go faster on multiple computers?

9 Exercise 3 Using Broadcast operation(15’) The master broadcasts a "Hello World" message to the slaves and slaves print out the messages. Both the master and slaves execute the same broadcast routine. The master is identified as the root (rank 0). The 4th argument/parameter of the broadcast routine is zero in all cases. – int MPI_Bcast( void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm ); Does the broadcast operation reduce the execution time? Discuss.

10 Assignment Submission Produce a document that show that you successfully followed the instructions and performs all tasks by taking screen shots and include these screen shots in the document. – Give at least one screen shot for each numbered task in each exercise. Due date sep 17 – doc and the source codes

11 Ref Course website: – http://acet.rdg.ac.uk/~mjeg/vt/ http://acet.rdg.ac.uk/~mjeg/vt/ – http://people.cs.vt.edu/~limin/cs4234/ http://people.cs.vt.edu/~limin/cs4234/ MPI References – http://mpi.deino.net/mpi_functions/index.htm http://mpi.deino.net/mpi_functions/index.htm Dr Ribben’s – http://courses.cs.vt.edu/~cs4234/MPI/first_exercise.html Dr. Sandu’s – http://people.cs.vt.edu/~asandu/Courses/CS4234/CS4234.html http://people.cs.vt.edu/~asandu/Courses/CS4234/CS4234.html


Download ppt "Using MPI on Dept. Clusters Min LI Sep 9 2010. Outline Run MPI programs on single machine Run mpi programs on multiple machines Assignment 1."

Similar presentations


Ads by Google