Valkyrie should only be used for parallel program development and measurement. If you need to use a Linux or UNIX system, please use your student account on the Solaris machines in the Advanced Programming Environment (APE) lab, located in APM 6426.
ACS has set up a web page providing documentation on how to use Valkyrie: http://www-acs.ucsd.edu/offerings/userhelp/HTML/rocks,d.html
Here are additional instructions about software we've added to simplify
the use of the machine.
On Valkyrie you may run with the bash shell or the csh shell, etc. You may change which shell you use with the chsh command. To get the correct compilers, you will need to set your path as follows. Add the following to your .bash_profile file which you should find in your home directory:
export PATH=/usr/mpich/c/bin:$PATH
With cshell add the following to you
.cshrc:
setenv PATH /usr/mpich/c/bin:$PATH
mpi-launch -m compute-0-0,compute-0-1 /home/cs260f/public/examples/Basic/hello
Here is some sample output:
# processes: 2 Hello world from node 0 Hello world from node 1Do the node ID's come in any particular order? Why is this?
In the second program each processor sends two integers to node 0, which prints out the values. A common convention is to call node 0 the manager or boss. Run program 2 several times on 4 processors. Do the node ID's come in any particular order? Why is this the case? Modify the program so that the nodes report to the manager in increasing order of node rank. Note the use of the MPI_Barrier() call, which provides barrier synchronization. Remove this call and note the effect.
The next program is called Ring and it can be used to measure communication performance. The program we've supplied you, Ring.C, is found in the Ring/ subdirectory of ~/../public/examples. This program treats the processors as if connected in a ring. Node 0 sends a message to successor node 1, and so on until node P-1, which then sends the message back to node 0, which is P-1's successor in in mod P arithmetic. The cycle then repeats. Messages of various sizes are passed around the ring, starting with 2 byte long messages and progressing in powers of two up to a user-specified limit.
Ring extracts up to 2 arguments from the command line:
By default NNN=1024,TTT=5. Under default settings Ring passes messages of 2, 4, 8, ..., 1K, ..., 256K five times around the processor ring. It calls MPI's built in timer MPI_Wtime() to measure message passing times, and reports the statistics based on these times as a function of increasing message length.
Ring uses MPI_Wtime() to collect wall clock times, Thus, your timings will reflect interference from other jobs. On a dedicated run, such interference will be minimal; running times will be shorter and reproducible. We aren't yet able to make dedicated runs, however. So run the program several times until you see consistent results. If you are still having difficulties getting consistent results, try running on other nodes. You should use no more than 4 nodes for this experiment.
To get an absolute time take the difference in times sampled by two successive calls to MPI_Wtime:
double t0 = MPI_Wtime();
// some code....
double t1 = MPI_Wtime();
double time = (t1-t0);
The man-page for MPI_Wtime()
is found on line. Note, however, that all times are
reported in seconds, and there is no need to divide
by MPI_Wtick() to convert to seconds.
(You can obtain the resolution of MPI_Wtime
using MPI_Wtick())
$ ssh-agent $SHELL $ ssh-addDo this once per login session.
mpi-launch provides the -m flag so you can specify which nodes to run on. The nodes are numbered from 0 to 15, and are named compute-0-0 through compute-0-15. (Each node contains 2 CPUs, but in effect you may use only 1 CPU per node.)
I've also set up some python scripts to select nodes for you automatically and simplify the command line specification. These will be particular helpful when debugging and are based on code originally written by Dave Sacerdoti, who now works with the Rocks group at SDSC.
There are two scripts contained in ~cs260f/../public/bin
(Set your PATH to include this directory to simplify matters.)
The first, runrand.py takes
allows you to specify the number of nodes you want to run with,
and will pick those nodes for you automatically, and
assemble all into an mpi-launch
command line and run the job for you.
For example, to run ring on 4 nodes with command line arguments
-t 3 -s 256 type:
runme.py 4 ring -t 3 -s 256
Runme avoids the needs to specify the complete path name of the executable, along with a long-winded list of nodes.
Of course, you may need to specify particular nodes, there is another script:
run.py 4 12 9 8 5 ring -t 3 -s 16
This will run ring as before, but on the 4 nodes
compute-0-{12,9,8,5}.
If you insist on using mpi-launch, the simplest invocation is:
$ mpi-launch -m [ comma separated list of compute nodes ] command args
You must specify the full pathname for the command.
For example, if user yoda wants to launch the program /home/yoda/hello-world on compute-0-4 and compute-0-5, yoda would execute:
$ mpi-launch -m compute-0-4,compute-0-5 /home/yoda/hello-world
Don't use MPIrun, as that utilizes the slower 100Mbit ethernet interconnect. (You must also set different path to use a different version of the compiler)
To
run the executable program Ring (found in ~/../public/examples/Ring)
on 4 processors with command line arguments 5 and 1024, you
type:
mpi-launch -mcompute-0-0,compute-0-1,compute-0-2,compute-0-3
/home/cs260f/public/examples/ring/ring 5 1024
Be sure and specify the full path of the executable
/usr/sbin/cluster-ps <username>If you see that some processes are running, use the cluster-kill command to delete them:
/usr/sbin/cluster-kill <username>Some nodes may be down, and the commands will detects this, (after a suitable delay, so please be patient)
As matter of etiquette, be sure and run cluster-ps
before logging out. If you plan to be on the machine for a long
time, it would be a good idea to run this command occasionally,
and before you start a long series of benchmark runs.
MPI documentation is found at at http://www.cse.ucsd.edu/users/baden/classes/cse260_fa02/testbeds.html#MPI. You can obtain man pages for the MPI calls used in the example programs described here:
Copyright © 2002 Scott B. Baden. Last modified: 10/08/02 09:3142 PM