Manual home / Installation
Installation · User Manual

Install the MPI runtime

Complete MPICH2 installation, account configuration and operation testing, and prepare the operating environment for TopMC computing.

Please prepare the MPICH2 installation program accompanying the TopMC release package first, check the version and calculate the number of program digits. The manual corresponds to MPICH2 1.4.1; this environment is also required to run TopMC serial calculation.

The accompanying picture shows the interface of the reference environment. Please fill in the installation directory, account name and program number according to the actual situation of the machine to avoid directly copying the example values ​​in the picture.

Install MPICH2 and connect to TopMC

  1. Run the accompanying .msi installer, follow the wizard to continue, and accept the license agreement. The installation process requires Windows administrator rights.
    Select the MPICH2 installer
    Figure 1 Select MPICH2 installer
    Accept the installation license agreement
    Figure 2 Accept the installation license agreement
  2. Record the installation directory and the Passphrase set during installation. Each node of the same parallel task must use the same Passphrase; it has a different purpose from the Windows login password registered later.
    Set Passphrase during installation
    Figure 3 Setting Passphrase during installation
  3. Select the applicable installation user scope and complete the installation. If the system asks for network access permissions, the actual calculation network allows relevant programs to communicate.
    Select installation directory and user scope
    Figure 4 Select the installation directory and user scope
    Complete MPICH2 installation
    Figure 5 Complete MPICH2 installation
  4. Open the bin folder in the MPICH2 installation directory and copy mpiexec.exe to Program\Calculation folder of TopMC.

After completing the installation and copying mpiexec.exe, you will have the MPI basic environment required for serial calculation. When using parallel calculation, please continue to complete account configuration and testing.

Configure paths and accounts

  1. Open "Advanced System Settings → Environment Variables" in Windows, edit the system variable Path, add the actual bin path of MPICH2, and retain the existing entries. For example:
    C:\Program Files\MPICH2\bin

    When installing in Program Files (x86) or other directories, please fill in the corresponding path. After saving, reopen the command prompt to make the new path take effect.

    Enter environment variable settings
    Figure 6 Entering environment variable settings
    Add MPICH2 bin directory to Path
    Figure 7 Add MPICH2 bin directory to Path
  2. Open bin\wmpiregister.exe, enter the Windows account and non-empty login password used to run the calculation, and click Register. Click OK when you see "Password encrypted into the Registry". Fill in the account password here, not the Windows Hello PIN; the manual requires the password to be no less than 6 digits.
    Fill in your Windows account and password and register
    Figure 8 Fill in the Windows account and password and register
    Confirm account registration is successful
    Figure 9 Confirm that account registration is successful
  3. Open bin\wmpiconfig.exe, select the workgroup, click Get Hosts, Scan Hosts, and Scan for Versions in order to check the computing node and its MPI version.

When multiple computers participate in the calculation, each computer must be configured with MPI; the TopMC installation path and data library path must be consistent.

Use the built-in example to check the running environment

  1. Open bin\wmpiexec.exe of MPICH2 and browse to examples\cpi.exe in the program selection box.
    Select the built-in test program cpi.exe
    Figure 10 Select the built-in test program cpi.exe
  2. To set a small number of processes (for example, 4), you can check run in a separate window to display the run window separately, and then click Execute.
    Set the number of test processes
    Figure 11 Setting the number of test processes
  3. Confirm that the example outputs normally and ends. This test is used to check the MPI startup environment; after passing it, the small TopMC calculation example is used to check the actual parallel calculation.
    View test program running results
    Figure 12 Check the test program running results

When registering, you should fill in your actual account name, not your full name. You can view the "Name" column in "Computer Management → System Tools → Local Users and Groups → Users" (when the system provides this feature). If the scanning node displays green, it means that the recognition is normal; some environments may operate normally even if they do not turn green. The actual test results of the examples and small TopMC calculations should prevail.

When node connection or test fails

First check whether the account password, node address, network access permissions, and Passphrase of each node are consistent. If the MPICH2 process management service is not installed correctly, you can enter the actual bin directory of MPICH2 in the administrator command prompt and execute:

smpd -install -phrase behappy
Install Process Management Service via Administrator Command Prompt
Figure 13 Installing the process management service through the administrator command prompt

behappy is only an example and must be replaced with the Passphrase used during installation. When you need to re-register the account, execute mpiexec -register and enter the user name and password as prompted, and then retest.

If the system does not provide graphical tools or sample programs, or it still cannot be started, please send the error message to [email protected] and explain the TopMC and MPI versions and calculation methods.

Testing MPI using the command line

In addition to graphics testing, the built-in examples can also be called in the command prompt. Replace the following path with the actual installation location of your native MPICH2, retaining the double quotes if the program path contains spaces:

mpiexec -n 4 "C:\Program Files\MPICH2\examples\cpi.exe"

-n 4 means starting 4 processes. Confirm that the example outputs the calculation results and ends normally, and then try TopMC's small calculation example. If mpiexec cannot be found in the command prompt, recheck the Path or use the full path to mpiexec.exe.

Example of starting an MPI program from the command line
Figure 14 Example of starting an MPI program from the command line

Optional: Visual Studio development configuration

This part is suitable for writing and compiling MPI programs by yourself. When using the published TopMC executable, there is no need to create a Visual Studio project for this purpose.

  1. Create a C++ console project in Visual Studio. Enter the project properties, select the configuration that needs to take effect, and confirm that the project target platform is consistent with the number of MPICH2 libraries.
    Visual Studio project properties and include directory entry
    Figure 15 Visual Studio project properties and include directory entry
  2. Add the MPICH2 include directory in "C/C++ → General → Additional Include Directories".
    Set MPICH2 header file directory
    Figure 16 Setting the MPICH2 header file directory
  3. Add lib directory under the same MPICH2 installation in "Linker → General → Additional Library Directory".
    Set MPICH2 library file directory
    Figure 17 Setting the MPICH2 library file directory
  4. Add mpi.lib in "Linker → Input → Additional Dependencies", keep the original dependencies of the project, and then apply the settings.
    Add mpi.lib link dependency
    Figure 18 Add mpi.lib link dependency
  5. After compiling the MPI program, find the actual generated .exe path and execute it in the command prompt:
mpiexec -n 4 "D:\MPI-Test\x64\Debug\test.exe"

The example path needs to be replaced with the location of the native build files. If the installation package used lacks header files or library files, you should first obtain the development assembly that matches the running environment and then compile it.

After completion, continue to configure TopMC

Confirm that mpiexec.exe has been copied to Program\Calculation of TopMC, and the serial or parallel startup method to be used can run normally. Then return to start TopMC and import the license, and then press the Windows Calculation Guide to start the calculation example.

When a problem occurs, please send the complete error report, Windows and MPICH2 versions, TopMC version and calculation method to [email protected].

Reference materials: MPICH2 graphic installation, configuration and testing tutorial; MPICH2 official installation guide. This page is rewritten according to the TopMC usage process; the installation package, path and parameters are subject to the supporting release version.

Author of the picture: Running Wolf (CSDN). Source: MPICH2 graphic installation, configuration and testing tutorial. The pictures are used under the CC BY-SA 4.0 license stated in the original text, and the original pictures and signatures are retained; this page has rearranged the order of the pictures and added picture numbers, and the pictures themselves have not been modified. This license applies to these attributed images.