There was a time when the department's installation on MPI was broken, and I gave directions to use an installation under the cs448b account instead. The department installation seems to work now, and I'm not maintaining the old install under cs448b. So, there's nothing that you need to do to your .bashrc.
If you did change your .bashrc according to the previous instructions, you can change it back. The old instructions had you set your PATH and LD_LIBRARY_PATH variables. If you were using the department defaults, then you shouldn't need to set these variables. If you've customized them for other reasons, just remove the entries for cs448b stuff.
ssh-keygen will ask you for a key phrase -- just press the
The -t rsa flag told ssh-keygen to generate a private/public key pair RSA public-key cryptography. You can also use DSA. If you care, give the command man ssh-keygen to read all about it.
Make 25 copies of the file
You can probably get away with only authorizing a few machines. It should be enough just to authorize the machines that you will run mpi from; I don't think you need to list every machine that mpiexec will be connecting to. Also, there might be a way to wildcard machine names, but I don't know how to do that.
Note, that at any given moment, any of the lin?? machines can be down. This is because they all live in a graphics lab in the basement of the ICICS building. Some student turn-off the machine they are using when they leave (even though it's obviously not a windoze box). So, if you can't connect to lin01 (or lin02), try a different machine. Of course, if you find you can't log on to any of the lin?? machines, ask for help.
chmod 600 ~/.mpd.conf |
chmod 755 ~/findhosts |
findhosts |
wc hosts |
mpicc -std=c99 c3s_mpi.c -o c3s_mpi |
mpiexec -n 1 -hostfile hosts `pwd`/c3s_mpi `pwd`/randomData |
The `pwd`/ in front of c3s_mpi and randomData is because of how mpiexec handles the idea of the current directoy. When MPI runs a process remotely, it apparently doesn't to a cd to the director from which you invoked mpiexec. So, I put the `pwd/ in front of c3s_mpi so the remote processes can find the executable. To make matters more confusing, this wasn't needed on the MPI install we had last year -- ouch!
I also put a `pwd`/ in front of randomData. I tried it with and without the `pwd`/ and it works either way. I'm guessing that this is because the count 3's program has the process of rank 0 read the file, and I'll guess that this is the process that is started from the command line (and therefore already has its directory set to the current one). I left the `pwd`/ in front of randomData for good measure -- it doesn't break anything, and it may prevent problems with the next version of MPI.
When I run the program with the command lne above, I get:
Hi! My name is 0, and I'm running on lin01 | |
My name is 0, and I counted 10133 3's | |
Number of 3's: 10133 |
% mpiexec -n 1 -hostfile hosts c3s_mpi randomData % mpiexec -n 2 -hostfile hosts c3s_mpi randomData % mpiexec -n 3 -hostfile hosts c3s_mpi randomData % ...Once you've said yes for a machine, you shouldn't have to do it again; so, this is a one-time hassle. Now, that you've got access to a bunch of hosts, try
mpiexec -n 4 -hostfile hosts c3s_mpi randomData |
Hi! My name is 0, and I'm running on lin01 | |
Hi! My name is 1, and I'm running on lin05 | |
Hi! My name is 2, and I'm running on lin04 | |
Hi! My name is 3, and I'm running on lin03 | |
My name is 1, and I counted 2490 3's | |
My name is 2, and I counted 2553 3's | |
My name is 3, and I counted 2526 3's | |
My name is 0, and I counted 2559 3's | |
Number of 3's: 10128 |