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
- Run the accompanying
.msiinstaller, follow the wizard to continue, and accept the license agreement. The installation process requires Windows administrator rights.
Figure 1 Select MPICH2 installer 
Figure 2 Accept the installation license agreement - 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.

Figure 3 Setting Passphrase during installation - 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.

Figure 4 Select the installation directory and user scope 
Figure 5 Complete MPICH2 installation - Open the
binfolder in the MPICH2 installation directory and copympiexec.exetoProgram\Calculationfolder 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
- Open "Advanced System Settings → Environment Variables" in Windows, edit the system variable
Path, add the actualbinpath of MPICH2, and retain the existing entries. For example:C:\Program Files\MPICH2\binWhen 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.
Figure 6 Entering environment variable settings 
Figure 7 Add MPICH2 bin directory to Path - 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.
Figure 8 Fill in the Windows account and password and register 
Figure 9 Confirm that account registration is successful - 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
- Open
bin\wmpiexec.exeof MPICH2 and browse toexamples\cpi.exein the program selection box.
Figure 10 Select the built-in test program cpi.exe - 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.

Figure 11 Setting the number of test processes - 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.

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

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.

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.
- 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.

Figure 15 Visual Studio project properties and include directory entry - Add the MPICH2
includedirectory in "C/C++ → General → Additional Include Directories".
Figure 16 Setting the MPICH2 header file directory - Add
libdirectory under the same MPICH2 installation in "Linker → General → Additional Library Directory".
Figure 17 Setting the MPICH2 library file directory - Add
mpi.libin "Linker → Input → Additional Dependencies", keep the original dependencies of the project, and then apply the settings.
Figure 18 Add mpi.lib link dependency - After compiling the MPI program, find the actual generated
.exepath 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.
TopMC®