MPI: MPICH2 Installation and Programming on a Local Area Network with Windows

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?

+6
source share
2 answers

Add the connected machines to the host file and transfer the file to mpiexec :

 <path-to-mpich2>/bin/mpiexec.exe -machinefile hosts.cfg -n nPEs <your-executable> 

Check sections 5.4 and 9 in the MPICH User Guide .

Update:

Yes, you need to install the MPI library on each computer. In addition, you need to run the process manager daemon on each computer and enable automatic remote login (for example, using ssh). Then run the test using mpdtrace or a simple hello world program that displays the hostname of each machine. If it works, and you will get different host names. If the installation is smooth, special configuration is not required (for example, setting the correct path to the library).

+3
source

After hard work, I was able to contact the support team, and the answer I received was:

Unfortunately, the MPICH team no longer supports its version of Windows.

However, there is still hope, since MS-MPI can still be used:

http://wiki.mpich.org/mpich/index.php/Frequently_Asked_Questions#Q:_Why_can.27t_I_build_MPICH_on_Windows_anymore.3F

Unfortunately, due to a lack of resources and developer interest, the latest version of MPICH that was supported on Windows was MPICH2 1.4.1p. There is minimal support for this version, but you can find it on the download page: http://www.mpich.org/downloads/ Alternatively, Microsoft supports a derivative of MPICH, which should provide the necessary functions. You will also find a link to the downloads page above. This version is much more likely to work on your system and will continue to be updated in the future. We recommend that all Windows users switch to using MS-MPI.

+2
source

Source: https://habr.com/ru/post/955828/


All Articles