MPI in LAMMPS
In this section, we will explore how LAMMPS uses the MPI in main.cpp
to execute the input script code in the correct order. The initialization is performed by MPI_Init
on line 36, as shown in the following screenshot:
Figure 14.3 – Screenshot showing MPI_Init in main.cpp
Next, a predefined communication domain descriptor, MPI_COMM_WORLD
, can be used (line 64), as shown in the following screenshot:
Figure 14.4 – Screenshot showing MPI calls in main.cpp
The MPI communication domain consists of two parts: process group and communication context. The process group is the collection of all the processes participating in the communication. If n
processes participate in the communication, the number is 0-n-1. The communication context provides a relatively independent communication area. Different messages are delivered in different contexts, and messages in different contexts do not interfere with each other. The...