I am studying MPI. The first thing I read is here
The code that I successfully run on Windows 7 with MSVC 2010:
#include "mpi.h" #include "iostream.h" int main(int argc,char *argv []) { int numtasks, rank, rc; rc = MPI_Init(&argc,&argv); if (rc != MPI_SUCCESS) { printf ("Error starting MPI program. Terminating.\n"); MPI_Abort(MPI_COMM_WORLD, rc); } MPI_Comm_size(MPI_COMM_WORLD,&numtasks); MPI_Comm_rank(MPI_COMM_WORLD,&rank); printf ("Number of tasks= %d My rank= %d\n", numtasks,rank); MPI_Finalize(); }
I successfully run this code on my Pentium-4 machine (don't be surprised that I still have one Pentium-4).
Now I want to run this code (or any other MPI code) on several computers connected to an Ethernet LAN. Say, for example, each machine sums from 1 to 1000 and sends it back to the node master, the node master then adds all these numbers to get the final amount.
My question is how to start MPI programming on the network? What all tools / software should be run on each machine.
I will be very grateful if you can give me a pointer to a tutorial.
MPI Implemnetation: MPICH2 OS:each machine is having Windows 7, 32 bit CPU: Intel Pentium 4 and Dual core Network: Ethernet IDE:MSVC2010
UPDATE:
I got some of my doubts clarified with Jev's answer. My last questions:
I install MPICH2 on every computer. After writing the names of each machine in a line in the cfg file, I need to do something else or just give a command:
<path-to-mpich2>/bin/mpiexec.exe -machinefile hosts.cfg -n nPEs <your-executable>
How do I know that my application runs on each machine? When starting the application, I need to make a special configuration, etc. On each machine?