Homework 0
Homework 0 - Due Wednesday, Jan 25, 2012
Provide the following information on paper or in an email. If you send an email, put 563
HW1 in the subject.
1. Your name.
2. A digital picture of your self. This will help me maybe learn some of your na
Comments about
matrix multiply
Self initialize
Gets rid of I/O bottleneck for timing
Tuesday, February 14, 12
Performance analysis
Goals are
1. to be able to understand better why your program
has the performance it has, and
2. what could be preventing
ECE 563 Spring 2012 First Exam
version 1
This is a version of the test with all changes described in email applied. It is due by 1:30 on
Thursday, March 1.
This is a take-home test. You must work, if found cheating you will be failed in the course and you
ECE 563 Spring 2012 First Exam
version 1
This is a take-home test. You must work, if found cheating you will be failed in the course and you will be turned
in to the Dean of Students. To make it easy not to cheat, this exam is open book, open notes, and y
Homework 9
Consider the loop:
int i1, i2, i3, j1, j2, j3;
float a[n][n] / n is a multiple of 5
for (i1=0; i1 < n-1; i1+=5) cfw_
for (j1=0; j1 < n-1; j1+=5) cfw_
for (i2=i1-2; i2<i1+2;i2+) cfw_
for (j2=j1-2; j2<j1+2; j2+) cfw_
a[i2][j2] = a[i2][j2]* a[i2-1
Dependence Analysis and Loop Parallelization Homework
Problem 1. Given the loop nest below:
for (i = 0; i < n; i + +) cfw_
x[i] = x[i-1] + x[i+1]
Fill in the table below:
Pair of
references
Dependent?
(Yes or No)
Kind of
dependence
Distance
of the
depend
HW 12 - UPC
1. Declare the following:
a. An N x N array of integers S whose rows are distributed across threads in the shared
space
shared [N/threads] int S[N][N]
b. An N element array of doubles S3 that is allocated across shared memory
i) show the alloc
Homework 11 - HPF
1. Consider the loop:
DO I = 1, N
DO J = 1, N
A(I,J) = B(I-1,J-1)
END
END
Show the distribution statements necessary for there to be no communication when the
I or J loop is parallelized.
!HPF DISTRIBUTE B(BLOCK,BLOCK) ONTO P(*,*)
!HPF A
Running MPI on the algol and qstruct clusters
In order to run MPI, the MPI runtime needs to know about what machines you will be running
on, and to ensure that you have permission to run on these.
The following is what I did in tcsh - you may need to use
Additional notes on the MapReduce project
An high-level overview of the system is shown below.
Mappers read data of the form <key, data> from the input les. In general, a parallel
le system can be used that allows each mapper to read from any le. In our
s
MapReduce
ECE 563 Spring 2012 Default Course Project
version 1.0 (1/22/2012)
Projects may be performed by teams of two people. If you would like to do another project, lets talk
about it.
MapReduce is a programming model that involves two steps. The first
Homework 1
Write and run an OpenMP program that:
1. Determines the number of processors available to run the program on a qstruct and
algol machine
2. Prints out a unique threadId for each thread using an OpenMP built-in function
3. Determines which threa
Homework 2
Write and run an OpenMP program to compute the following recurrence:
for (int i = 0; i<n; i+) cfw_
t = t + a[i];
print(t);
Write two versions of the program:
1. Write a version using the OpenMP reduction clause
2. Write a version without using
Homework 3
This is the same as Homework 1, except use Java or Pthreads.
Write and run an Java or Pthreads program that:
1. Determines the number of processors available to run the program on a qstruct and
algol machine
2. Prints out a unique threadId for
Homework 4
This assignment is similar to Homework 3 that used OpenMP.
Write and run a Java or Pthreads program to compute the following recurrence:
for (int i = 0; i<n; i+) cfw_
t = t + a[i];
print(t);
The program should solve the recurrence in parallel.
Homework 5
Using any threading programming model you want (i.e. OpenMP, Java or Pthreads)
write a parallel matrix multiply. Run this for arrays of size 100 x 100, 1000 x 1000 and
10000 x 10000. You may use the nearest largest power of 2 for the array size
Homework 6 - Due Wednesday, Feb. 16, 2011
Write and run an MPI program to compute the following recurrence:
for (int i = 0; i<n; i+) cfw_
t = t + a[i];
print(t);
Write two versions of the program:
1. Write a version using MPI collective communication.
2.
Shared memory programming
with Java and Pthreads
Thanks to LLNL for their tutorial
from which these slides are derived
http:/www.llnl.gov/computing/tutorials/
workshops/workshop/pthreads/MAIN.html
Friday, January 27, 12
Many Java Virtual Machines use
Pth
Introduction to MPI
Monday, January 30, 12
Topics to be covered
MPI vs shared memory
Initializing MPI
MPI concepts - communicators, processes,
ranks
MPI functions to manipulate these
Timing functions
Barriers and the reduction collective operation
M
HW 13 - UPC
1. Declare the following, in all cases assume that N is a multiple of the number of
images if that is convenient.
a. An N x N array of doubles S whose rows are distributed across images
b. An N x N array of doubles P that is contained in priva