CS 480 Introduction to Parallel Computing
Fall 1999
Programming Assignment #2
Due: 9/24, noon.
40 points.
Goals:
-
to create a pvm hostfile
-
to experiment with pvm message-encoding parameters and the location of
spawned processes
-
to compare multicast with sending individual messages
-
to experiment with message and machine size
-
to learn how to time programs
-
to organize the results of many experiments
-
to analyze data and draw conclusions
Source files for this assignment: psum.c,
spsum.c,
timing.c,
timing_slave.c
Also available in the class library - lab2 subdirectory SCI-machines
Pvm concepts introduced in this lab:
-
using a hostfile
-
using pvm_spawn to spawn process on a specific host
-
pvm data formats
Exercise I. Creating and using a hostfile.
-
Using a text editor create a hostfile (reference)
containing
two other machines from the "star trek" group.
-
Start the pvm console using the command: pvm hostfile
-
Check that your virtual machine was correctly started.
-
Halt the VM.
Note that the console machine is included in the VM by default.
Exercise II. Message format, Slave location and message size.
In this exercise you will conduct some experiments to determine the effect
of the parameters in the table below on pvm program performance.
variable |
possible values |
description |
location of slave process relative to master |
master hostname or other machine in VM |
the name of the host that the slave is spawned on |
Message Data format |
PvmDataRaw, PvmDataDefault, PvmDataInPlace |
The encoding scheme used by pvm. PvmDataDefault encodes the data so
that it can be sent to hosts that use different binary formats. PvmDataRaw
does no encoding - useful when you know the host types are the same. PvmDataInPlace
does not make a copy of the buffer - intended to save time. |
Size of message |
100 bytes, 1000 bytes, 10000 bytes |
|
Examine the programs: timing.c and timing_slave.c
The timing program spawns a single slave process. The slave process
simply waits for any message; it sends an acknowledgment of each message
received back to the sender. The timing program computes two timing
results. The first is the return trip time for a short message.
The average of 20 such messages is determined and printed. The second
result computes the same quantity for a larger message. Again the average
of 20 such messages is determined and printed. The time required to pack
the data into the send buffer is also computed and printed.
Examine the source code to make sure you see how each of these results
is accomplished by the code.
These programs include code to determine the amount of time used by
parts of the application.
Look for gettimeofday function calls to see how elapsed time
is computed.
Running your programs.
To run these sample programs, quit the pvm console (not halt) and run as
a normal unix process. Your PATH environment variable has been changed
to include the pvm binaries subdirectory.
-
Edit the file timing.c and change the variable SLAVEHOST from "whoami"
to the name your master will run on.
-
Compile and run the programs to see what the output looks like.
-
In the tables below, enter the indicated average times. Determine
these values by editing the source files and setting the parameters to
the specified values. There are 24 possible combinations
Table I -A. Return trip times. Homogeneous Architecture
A ( SGI O2 )
Master/Slave on same host
msg size |
Raw |
Default |
InPlace |
100 |
|
|
|
1000 |
|
|
|
10000 |
|
|
|
|
Master/Slave on different hosts
msg size |
Raw |
Default |
InPlace |
100 |
|
|
|
1000 |
|
|
|
10000 |
|
|
|
|
Table I-B. Return trip times. Homogeneous Architecture
A ( ALPHA )
Master/Slave on same host
msg size |
Raw |
Default |
InPlace |
100 |
|
|
|
1000 |
|
|
|
10000 |
|
|
|
|
Master/Slave on different hosts
msg size |
Raw |
Default |
InPlace |
100 |
|
|
|
1000 |
|
|
|
10000 |
|
|
|
|
Table I-C Return trip times. Homogeneous Architecture
A ( SGI MP )
Master/Slave on same host
msg size |
Raw |
Default |
InPlace |
100 |
|
|
|
1000 |
|
|
|
10000 |
|
|
|
|
Master/Slave on different hosts
msg size |
Raw |
Default |
InPlace |
100 |
|
|
|
1000 |
|
|
|
10000 |
|
|
|
|
Table I-D. Return trip times. Heterogeneous Architecture
SGI O2 - ALPHA
Master/Slave on same host
msg size |
Raw |
Default |
InPlace |
100 |
|
|
|
1000 |
|
|
|
10000 |
|
|
|
|
Master/Slave on different hosts
msg size |
Raw |
Default |
InPlace |
100 |
|
|
|
1000 |
|
|
|
10000 |
|
|
|
|
Table II. Return trip times - Short message
Master/Slave on same host
Arch |
Time |
SGI O2 |
|
SGI MP |
|
ALPHA MP |
|
|
Master/Slave on different hosts
Archs |
Time |
O2 - O2 |
|
O2 - Sigma |
|
O2 - Alpha |
|
|
Table III. Data Packing times SGI O2
Master/Slave on same host
msg size |
Raw |
Default |
InPlace |
100 |
|
|
|
1000 |
|
|
|
10000 |
|
|
|
|
Master/Slave on different hosts
msg size |
Raw |
Default |
InPlace |
100 |
|
|
|
1000 |
|
|
|
10000 |
|
|
|
|
Note your observations:
Exercise III. Multicast vs. Individual sends
The master program, psum.c from class has been modified to
include timing calculations.
-
Scan through the program to see the additions.
-
Compile and run these programs (psum.c , spsum.c) to see what the output
looks like.
As given, the master does a broadcast (multicast) of the entire array
to all children.
Alter the master and slave so that the master sends only the data that
each child needs.
Compile and run the programs and record the timing results below.
Run the programs first with 2 slave SGI O2s, then add 2 slaves on Alpha,
then 2 more on Sigma.
Note the changes that you had to make here.
Table III. Timing values for psum, spsum application.
|
Multicast |
Individual sends |
number of slaves |
|
|
2 |
|
|
4 |
|
|
6 |
|
|
Questions.
-
What is the purpose of the hostfile?
-
What conclusions can you draw from the data you gathered in exercise 2?
-
What conclusions can you draw from the data you gathered in exercise 3?
-
What issues do you think need to be taken into consideration in analyzing
the above data sets?
TURN IN:
you should submit a well organized report contaning:
-
results of experiments
-
relavent C source code segments
-
Observations
-
Answers to Questions.
Format:
-
Electronic - Html preferred, MS Word, email to gzimmer@cs.bgsu.edu
Inlcude cs480pa2 in subject line
-
Paper Word processed
Last modified: 9/15/99
Author: G.Zimmerman