Deprecated: please see new documentation site.



This page is for the exercises to the Intro to MPI presentation.

Exercise 1 - Write a Program that prints out 'Hello World from proc X out of Y'

Exercise 1 Solution

Exercise 2 - Write a program that has all even procs print "even X" and odd procs print "odd y"

Exercise 2 Solution

Exercise 3 - Write a program that has processor 0 send three integers to processor 1, and have processor 1 receive three integers from processor 0. Execute the program with only 2 processors.

Exercise 3 Solution

Exercise 4 - Write a program that has processor 0 read in a text file and broadcast out the number of entries and then the data read. The text file should have the following format:

[user@machine]$ cat test.txt
 3
 1
 2
 3
Exercise 4 Solution

Exercise 5 - Write a program that utilizes the function MPI_Reduce().

Exercise 5 Solution

How to Compile and Run Your Exercises Interactivly

Show Solution

Example Batch Job Script

Show Script

To find out your allocation name, execute the command:

[user@machine]$ balance
======================= Allocation information for user =======================
  Proj. Name|       Alloc|  Balance| Deposited|    %Used| Days Left|       End
--------------------------------------------------------------------------------
loni_project|loni_project| 44520.92|  50000.00|    10.96|       246|2009-10-01

Users may direct questions to sys-help@loni.org.

Powered by MediaWiki