This semester, I chose a small assignment, "Parallel Programming Technology in computing science and engineering", and posted some unexpected detours in the configuration environment: MPI is installed in the running report student ID: ** name: ** local running environment: Machine Model: Lenovo ideapadY460CPU: IntelCorei5M430 clock speed: 2.27 Ghz (dual-core four-thread) Running memory (RAM ): 2 GB Operating System: Wi
This semester, I chose a small assignment, "Parallel Programming Technology in computing science and engineering", and posted some unexpected detours in the configuration environment:
Install MPI in running report
Student ID: ** name :**
Local running environment:
Machine Model: Lenovo ideapad Y460
CPU: Intel Core i5 M430 clock speed: 2.27 Ghz (dual-Core four-thread)
Running memory (RAM): 2 GB
Operating System: Windows 7 (32-bit)
Development Environment: Visual Studio 2008
MPI version:
Directly use the mpich2-1.3.2p1-win-ia32 installer given by the instructor.
Detailed installation steps:
1. Run mpich2-1.3.2p1-win-ia32.msi.
A passphrase is required during installation. The default passphrase on my machine is beHappy, which is a very interesting password. It is very important to set this item. Remember it. The following will explain why.
2. After installation, I do not know how to proceed. Open the shortcut directory of MPICH2 just installed and find a README file. After opening it, I found the use method of MPICH2, so according to the instructions, I wrote the first MPI parallel program.
I am using VC ++ 2008. First, create a new project named MPITest.
Added support for the MPI Library:
According to the instructions in README, we should first include the MPI header file directory in the project. After searching for the Project Properties for half a day, I did not find the location where the header file directory was added. I only found the location where the library file was included. The directory where I installed MPICH2 was D: \ Program Files \ MPICH2: add the library file of MPICH2 to the location shown below.
In the end, the project is still empty and there are no files. It may be related to this project. As a result, a Cpp file main. cpp was created immediately, and the example program in the instructor PPT was copied.
Figure 1
Indeed, after the cpp file is created, the project attribute contains the C/C ++ option, so you can set the directory containing the file, the corresponding configuration is shown below.
Figure 2
After setting these files, compile the program and report an error when connecting the results, similar to "main. obj: error LNK2019: the external symbol _ MPI_Finalize that cannot be parsed. This symbol is referenced in function _ main. "six such errors occur. Read the README document again and find the following sentence:
For C applications add mpi. lib to your target link command.
As a result, you may need to explicitly add mpi library support in the project. After setting the response lib at the position shown below, re-compile and connect the program and pass it smoothly.
Figure 3
Then compile and run the program directly. The interface shown below shows that the program runs only on the local machine and has not been executed in parallel.
Figure 4
Then, according to README and online instructions, after MPICH2 is installed, a service process named smpd should appear in the system. I re-installed MPICH2 multiple times, used the task manager to view the processes in the system, and did not find the smpd process. I found the program in the installation directory and double-click it to run it. When running a parallel program, the following Error message is displayed: "Error: No smpd passphrase specified through the registry or. smpd file, exiting.", as shown below.
Figure 5
I have no time to study and solve the problem because I have to work during the day. So I decided to temporarily switch to Linux, download and install Ubuntu 10.10 With Wubi. For detailed installation steps, see the following section. Later, during the course, a student from Tsinghua successfully configured MPICH2 in the Win7 environment, so I went to ask for advice. Originally, this is an example of using the Administrative Account to start the command line (run with the administrator ID to run cmd.exe), and then enter smpd-install-phrase *****. The asterisk part is the passphrase you set earlier. Finally! As shown below
Using MPIEXEC wrapper again to run the parallel program, the correct result is finally displayed! It's so hard ...... As shown below.