Program #3 -- CS 491
Part a
Write gaussian elimination to spawn N processes and use a shared memory
segment to control the flow of computation -- like we did in class.
The idea is to decompose gaussian elimination into N tasks , each task will
attempt to do as much computation it can while waiting on the above/below tasks.
We will use spin locks to control the running of tasks until the dependent
task is complete
Your main program should read in an an input file. The input will be
N -- the number of equations
N x N+1 N rows, each row indicates the coefficients of the equation and then
the result of that equation.
You will spawn N processes, eacn process will be assigned the task to complete
forward resolution and then back solve. Use spin locks to wait for dependent tasks.
Run your program on 5x5 and 10x10 equations, time them on a single processor machine
as well as on lolb2.cs.nmsu.edu. Run each test 3 times
Expected output, four average timing values .
Part b
Controlling process.
Modify the gaussian elimination code from above to limit the
number of processes created. Your program should read a single argument
which indicates to your program how many children processes you should create.
So your input will be
X
N
N x N+1
Where X is the number of spawned tasks.
Your program should create that many children process AND allocate tasks
to each process so that each process has a similar load. You are to
document how this is done in your computer AND you are to write a 2-3 paragraph
response on how you did this.
The input is like:
gauss N
-- create N children
Output :
correct gaussian elimination output
Each child should have a balanced load.
What is to be handed in
1) Your program WITH comments on how you dispatched the tasks to the processes
2) A 2-3 paragraph paper indicating how you dispatched the tasks. You must
make an intelligent argument on why your task allocation is correct.