I am learning MPI. The first tutorial I followed is here
The code that I run successfully on Windows 7 with MSVC 2010 is :
#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 am successfully running this code on my Pentium-4 machine (dont be surprised I am still having one Pentium-4).
Now I want to run this code (or any other MPI code) on multiple machines connected in a Ethernet LAN. Say for example each machine sums 1 to 1000, and send back to a master node, the master node then adds all those numbers to get the final sum.
My question is how to start MPI programming in a network? What all tools/softwares should I run in each machine.
I will really appreciate if you can give me a pointer to a tutorial.
MPI Implemnetation: MPICH2
O.S:each machine is having Windows 7, 32 bit CPU: Intel's Pentium 4 and Dual core
Network: Ethernet
IDE:MSVC2010
UPDATE:
I got some of my doubts cleared with Jev's answer. My latest questions are:
Do I install MPICH2 in each machine. After writing names of each machine per line in the cfg file, Do I need do anything else or just give the command:
<path-to-mpich2>/bin/mpiexec.exe -machinefile hosts.cfg -n nPEs <your-executable>
how would I know that my application is running on every machine? While running the app do I need to do some special configuration etc on each machine?