Alfie Parthum's Supercomputing Wonderland - lmpi

File(s)
Screenshot(s)
Description
lmpi.tar.gz
All the code and stuff. Yay. Basically, this is what we all learned for MPI. It could:
a) Give you eternal enlightenment as to the nature of your MPI assignment and therefore the whole of parallel computing, or
b) Not help you in any way whatsoever. Ha ha.
Anyway, you should change the Makefile to fit with YOUR MPI setup, because you might not want to run it the way I do over in the lab. On the Cray, you want to use plain old cc/CC to compile, and to run:
mpirun -nt (some multiple of 4 up to 16) ./program
On the workstations at the lab, it seems to be a tad advanced, but that's what the Makefile is geared to, and it runs a bit like this:
mpirun.mpich -np (number of processes) -machinefile (file with names of machines that work) ./program 2>/dev/null
(that devnull thing is just to get rid of all those logon alerts; if you have errors, though, they will NOT show up) or to run on just one computer:
mpirun.mpich -np (number of processes) -all-local ./program 2>/dev/null
See what I mean? And if you aren't even from our lab, I hope you know how to run MPI stuff on your system, because I sure can't tell. Heck, there's really no guarantee it will work this way next year. Eeeeeeeeeeee.
March 21, 2004 [View Makefile]
hello.c
It's your standard MPI "Hello World", except NOT. I hate "Hello world". I've never made a program that did that. My first output was "I are a programmer." Not "Hello world". But now that I do not have to assert that I are a REAL programmer, I sorta compromise. You'll see, but it's not like it's much of a big deal....
March 21, 2004 [View hello.c]
share.c
This uses 3 common methods for getting a value to all the nodes. Call the program like this:
[mpi options] ./share [version]
where [version] is 1, 2, or 3. Version 1 sends everything from node 0 using MPI_Send() on one end and MPI_Recv() on the other. Version 2 uses MPI_Bcast, which makes things oh-so-much easier. Version 3 sends it from node 0 to 1 to... well, however far it goes.
March 21, 2004 [View share.c]
salary.c
Pass a message around a ring, but different every time. Basically, it's a simulation of people at a party, calculating their average salary, while keeping individual ones secret.
March 21, 2004 [View salary.c]
pi.c
Calculating pi using one of the worse methods for computers. That is, pi/4 == 1 - 1/3 + 1/5 - 1/7....
Or as implemented in this algorithm, the sum where k equals one to infinity of negative four squared over two times k minus one. Eh, just look at the code if you really care.
March 21, 2004 [View pi.c]
fun.c
Calculating pi using an algorithm I barely understand myself. Err, yeah.
March 21, 2004 [View fun.c]
zzz.c
Calculating pi using a digit-extraction algorithm. I don't really understand it, but hey, it works!
March 21, 2004 [View zzz.c]
unisearch.cpp
*NOT INCLUDED IN Makefile!!*
A serial version of a program that searches for a value in an array. It is only on the page for purposes of the assignment.
May 19, 2004 [View unisearch.cpp]
parasearch.cpp
Parallel code of the serial version above (sort of. I may have overlooked something). Much harder than you would think, but oh well. That's why they're called "exercises".
March 21, 2004 [View parasearch.cpp]
mat1.c
Sends rows of a matrix to other processes. Easy.
May 19, 2004 [View mat1.c]
mat2.c
Sends columns of a matrix to other processes. Not easy, apparently, but I didn't have much of a problem....
May 27, 2004 [View mat2.c]
Absolutely nothing here is really copyrighted, except the design, which was stolen from a site that no longer uses it anyway. Feel free to narf anything you need, though, as long as it doesn't interfere with any applicable licenses, subsidiaries, city ordinances, et cetera et cetera et cetera. And it never hurts to drop me a line! If you like what you see, you can find more of me at my TJHSST page or my personal domain, The BRPXQZME Network.