Multi-stage compression storage method for irradiation damage AKMC simulation
Through the multi-level compression storage method and hash table query, the problems of large memory consumption and communication volume in parallel AKMC simulation software in terms of storage and communication are solved, and support for ultra-large-scale simulations and memory optimization are achieved.
Patent Information
- Application Number
- CN202410713577.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-10-01
AI Technical Summary
Existing parallel AKMC simulation software has problems with large memory consumption and large initialization communication volume in terms of storage and communication, making it difficult to cope with ultra-large-scale simulation environments.
A multi-level compression storage method is adopted, the information of solution atoms is not stored, a hash table is used for query, and the information of non-solution atoms is synchronized through MPI communication to reduce the amount of communication data.
It effectively reduces system memory consumption and initialization communication volume, improves the expansion capability of simulation scale, and achieves compression of storage and communication volume.
Smart Images

Figure CN118740164A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer high performance computing numerical simulation, and in particular relates to a multi-level compression storage method for radiation damage AKMC simulation. Background Art
[0002] Nuclear energy plays a very important role in power generation. Reactor pressure vessels are key components of most nuclear power plants. Therefore, using computers to simulate radiation damage to reactor pressure vessels helps to understand and predict the microscopic properties and macroscopic changes of materials under radiation damage. Therefore, simulating material radiation damage is also an important part of numerical reactor software. An important means to study the problem of material radiation damage is to use multi-scale simulation methods. Among them, the Kinetic Monte Carlo (KMC) method is one of the most important methods in multi-scale simulation methods. Similar to the general Monte Carlo idea, the core idea of the KMC method is to randomly extract events. If we can determine all possible events that may occur in the current state of the system and know their probability of occurrence, then we can use the probability of these events as weights to randomly extract events to change the state of the system, thereby promoting the forward evolution of the system.
[0003] There are many studies on KMC methods, which are divided according to how the research object moves or reacts. Including Atomic Kinetic Monte Carlo (AKMC), which takes atoms as the basic objects and performs KMC on the atomic lattice. It considers the microstructural evolution caused by the transition between atoms and defects, and coarsens the "atomic motion trajectory" into "system configuration transition".
[0004] On the one hand, existing parallel AKMC simulation software is basically based on regional decomposition, which divides the simulation area into multiple sub-areas and assigns them to different computing units. That is, the types of all atoms in the simulation area will be stored in the computer. Multiple research teams have been working hard to improve the large-scale KMC simulation capabilities. However, traditional storage methods will greatly restrict the scale of program simulation under limited hardware conditions, making the simulation of trillions of atoms still a huge challenge in terms of memory.
[0005] On the other hand, existing parallel AKMC simulation software usually adopts the synchronous sub-lattice (SL) algorithm, and the communication method basically adopts on-demand communication, which requires that at the beginning of the program running, each process synchronizes its own ghost area through the message passing interface (MPI) communication. Since the amount of communication data is related to the atomic scale of the simulation, the size of the communication send and receive buffers will increase as the simulation scale expands, resulting in high peak memory consumption. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a multi-level compression storage method for AKMC simulation of radiation damage in view of the above-mentioned deficiencies of the prior art. By no longer storing the information of solution atoms, the method can effectively solve the problems of large memory consumption and large amount of inter-process communication during initialization in the existing storage mode.
[0007] A multi-level compression storage method for radiation damage AKMC simulation includes the following steps:
[0008] Step 1: All processes started by this AKMC simulation determine the number of solute atoms and the number of vacancies allocated to the current process according to the total number of solutes and the total number of vacancies set for this simulation and the process number in the Cartesian communication domain.
[0009] Step 2: First-level compression storage: each process generates a corresponding number of local IDs according to the number of solute atoms and vacancy bits allocated, and stores the local IDs as keys in the corresponding solute hash table and vacancy hash table.
[0010] Step 3: Secondary compression storage. Before the calculation starts, each process synchronizes the non-solution atom information in its own surface area to the ghost area corresponding to the neighboring process through MPI communication.
[0011] Step 4: After steps 1 to 3, the compression storage method has completed the compression of the storage. However, after the compression storage is completed, since the information of the solution atoms is no longer stored, the acquisition of atomic information changes from query to judgment. It is necessary to calculate the local ID based on the local coordinates, and then use the local ID to query each hash table to determine the atom type corresponding to the local coordinates.
[0012] Further, in step 1, each process determines the number of solute atoms and the number of vacancies allocated to the current process according to the total number of solutes in the system, the total number of vacancies, and the process number of the process in the Cartesian communication domain:
[0013] 1.1. Each process reads the configuration file to obtain the total number of solutes and total number of vacancies in the current simulation environment.
[0014] 1.2. Divide each process evenly, that is, calculate the total number of solutes and total number of vacancies divided by the total number of processes.
[0015] If the divisor has a remainder, the remainder is evenly distributed according to the process number in the Cartesian communication domain, that is, the number of solutes and vacancies allocated to the first remainder processes is increased by one.
[0016] Further, in step 2, each process generates a corresponding number of local IDs according to the number of solute atoms and the number of vacancies divided, and stores the local IDs as keys in the corresponding solute hash table and vacancy hash table. Specifically:
[0017] 2.1. The process generates a corresponding number of local IDs according to the number of solutes and vacancies divided.
[0018] 2.2. Store the local ID of the vacancy atom in the vacancy hash table, and store the local ID of the solute atom in the corresponding solute hash table.
[0019] Furthermore, in step 3, before the calculation starts, each process synchronizes the data of its own surface area to the ghost area corresponding to the neighboring process through MPI communication. Specifically:
[0020] 3.1. Due to the use of compressed communication, a compressed communication structure is designed. The compressed communication structure array will be transmitted during MPI communication. In the original MPI communication, an integer array is transmitted, and each array element represents an atomic type.
[0021] The structure of compressed communication: subscript, atom type. The subscript indicates the position of the non-solution atom in the original integer array. The atom type indicates which type of solute atom or vacancy atom the non-solution atom is.
[0022] 3.2. Use the compression storage algorithm to transmit the surface area data to the neighboring process.
[0023] Furthermore, the compression storage algorithm described in step 3.2 is specifically:
[0024] 3.2.1. Traverse all the data in the surface area of the first dimension and add the subscripts and atom types of non-solution atoms to the sending buffer.
[0025] 3.2.2. Each process transmits the data in the send buffer to the neighboring process in the first dimension.
[0026] 3.2.3. Each process receives the data sent from the neighboring process into the receiving buffer.
[0027] 3.2.4. Traverse the data in the receiving buffer and update the corresponding non-solution atom type data in the ghost area according to the subscript.
[0028] 3.2.5. The data in the remaining locations of the ghost area (whose subscripts do not appear in the data in the receive buffer) are treated as solution atoms for update synchronization.
[0029] 3.2.6. Repeat 3.2.1 to 3.2.5 until the surface area data of all dimensions are synchronized.
[0030] Further, in step 4, the determination of the atom type according to the local ID of the atom is specifically as follows:
[0031] 4.1. Get the local coordinates of the atom in the current process.
[0032] 4.2. The local ID can be calculated based on the local coordinates. Taking the two-dimensional case as an example, assuming that the local coordinates are (x0, y0), the size of the subdomain that the current process is responsible for is x*y, then the local ID corresponding to the local coordinates is x0*x+y0.
[0033] 4.3. Query the type of the atom in the hash table based on the local ID.
[0034] Further, the query process described in step 4.3 is specifically as follows:
[0035] 4.3.1. Check whether the local ID is in the vacant hash table. If it is, the query ends and the atom is determined to be a vacant atom.
[0036] 4.3.2. If the local ID is not in the empty hash table, check whether the local ID is in the hash table of solute type one. If it is, the query ends and the atom is determined to be solute one atom. If it is not, repeat 4.3.2 until the hash table of a solute atom is found or all solute hash tables are searched.
[0037] 4.3.3. If there is no key for the local ID in all solute hash tables and vacancy hash tables, the atom is judged to be a solution atom.
[0038] Beneficial effects of the present invention:
[0039] The present invention improves the existing storage strategy by using a multi-level compression storage method. The existing storage strategy has no targeted optimization and is difficult to deal with the problem of memory bottleneck during ultra-large-scale simulation. The present invention can greatly reduce the consumption of system memory and the communication volume of initialization communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is the overall flow chart of the method of the present invention;
[0041] Figure 2 A flow chart for dividing the number of solute atoms and the number of vacancies in the method of the present invention;
[0042] Figure 3 This is a first-level compression storage flow chart in the method of the present invention;
[0043] Figure 4 It is a flow chart of the first-level compression storage algorithm in the method of the present invention;
[0044] Figure 5 It is a two-level compression storage flow chart in the method of the present invention;
[0045] Figure 6 The query algorithm flow chart of the method of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the present invention more clear, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings.
[0047] The storage scheme of existing software that uses the AKMC method for radiation damage simulation simply stores all atomic information in the simulation area. The proportion of solute atoms and vacancy atoms is usually low, and the proportion of solution atoms is high. However, the number of solution atoms that need to be accessed during the actual calculation process is usually small. This will result in the storage of a large amount of useless solution atom information. This problem also indirectly leads to a large amount of communication volume when initializing communication. These problems make it difficult for existing storage methods to cope with the simulation of ultra-large-scale environments.
[0048] The core idea of the embodiment of the present invention to improve the existing storage scheme for irradiation damage simulation using the AKMC method, which has large storage capacity and large initial communication volume, is that the information of solution atoms is not stored, and solution atoms are not communicated during initialization communication.
[0049] The embodiment of the present invention reduces the occupancy of memory through multiple hash tables. The existing storage method is an array, and each element in the array stores the type of atoms, and each element corresponds to the atomic information of each position in the simulation space. That is, how large the atomic scale of the simulation is, the information of the number of atoms of the corresponding scale needs to be stored in the memory. In addition, in the initialization communication stage, it is also necessary to communicate the data in the entire surface area to the ghost area of the neighbor process. The larger the scale of the simulation is, the larger the size of the sending buffer and the receiving buffer is, and the larger the communication volume is. It can be seen from this that this storage method and the initialization communication method will greatly restrict the simulation scale of the software. Therefore, if you want to further expand the simulation scale, you need to compress the storage.
[0050] Figure 1 A schematic flow chart of a multi-level compression storage method for AKMC simulation of radiation damage provided by the present invention. Figure 1 As shown, the method includes steps S101-S104:
[0051] The storage logic of the original software is as follows: first, the entire simulation area is divided into regions according to the topological structure of the process, and each process uses an array for storage. Each element in the array is relative to the atoms at each position in the partial area divided by the process. Then, in the initialization communication phase, each process generates a sending buffer with the same size as the surface area and a receiving buffer with the same size as the ghost area. All data in the surface area are then sent to neighboring processes through MPI point-to-point communication.
[0052] The embodiment of the present invention makes improvements to the storage method and the initialization communication method of the system, and the improvement steps include:
[0053] Step S101, each process determines the number of solute atoms and the number of vacancies to which the current process is allocated according to the total number of solutes in the system, the total number of vacancies, and the process number of the process in the Cartesian communication domain, such as Figure 2 shown.
[0054] Specifically, at the beginning of program execution, each process must first read the same configuration file, which contains relevant settings for this simulation environment. Such as: total solute number, total number of vacancies, simulation temperature, number of simulation steps, etc. Then, each process will use the MPI_Cart_create function to create a Cartesian topology and obtain the process number of the process in the communication domain of the Cartesian topology. Each process can obtain the minimum number of solute atoms allocated to each process by calculating the total number of solutes divided by the number of processes. If there is a remainder, the number of solute atoms allocated to the process with the first remainder is increased by one according to the process number of the process in the communication domain of the Cartesian topology. The same is true for the number of vacancies calculated by each process.
[0055] Step S102, first-level compression storage, each process generates a corresponding number of local IDs according to the number of solute atoms and vacancies divided, and stores the local IDs as keys in the corresponding solute hash table and vacancy hash table. Figure 3 shown.
[0056] Specifically, according to the number of solute atoms and the number of vacancy atoms obtained in step S101, an equal number of local IDs are randomly generated, and then these local IDs are stored in the corresponding hash table. The first level of compression is performed using a compression storage algorithm such as Figure 4 As shown, i represents the type of solute atom, and M represents the number of solute atom types.
[0057] The specific process of the first-level compression storage algorithm is as follows:
[0058] (1) According to the number of solute i atoms obtained in step S101, an equal number of local IDs of solute i atoms are randomly generated.
[0059] (2) Store these local IDs in the hash table of solute i atom in sequence.
[0060] (3) Repeat (1) and (2) until all types of solute atoms have randomly generated a corresponding number of local IDs and stored these local IDs in the corresponding hash tables.
[0061] (4) According to the number of vacancy atoms obtained in step S101, an equal number of local IDs of vacancy atoms are randomly generated.
[0062] (5) Store these local IDs in the hash table of vacant atoms in sequence.
[0063] Step S103, secondary compression storage, before the calculation starts, each process synchronizes the data of its own surface area to the ghost area corresponding to the neighboring process through MPI communication. In this process, the information of the solution atoms is no longer communicated, such as Figure 5 As shown in the figure, taking the two-dimensional case as an example, the green area represents the ghost area and the surface area, and the dots in the area represent the atoms in the surface area. The four numbers 1 to 4 represent the sector numbers.
[0064] Specifically, Figure 5 The above is a schematic diagram of the data transmission from the surface area to the ghost area of the neighboring process. Figure 5 The lower left side is the existing initialization communication mode, which takes out all the atomic information in the surface area in turn and stores it in the sending buffer, such as Figure 5 The "iron, iron, copper, space, iron, iron" in the message is sent to the neighboring process through MPI's point-to-point communication. The neighboring process will overwrite all the data in the receiving buffer into the ghost area in turn to complete the synchronization operation. Figure 5The lower right side is a two-level compression storage mode, which stores the non-solution atoms in the surface area in turn into the sending buffer. The data that needs to be stored in the sending buffer becomes "<2, copper>, <3, vacancy>". The numbers are used to indicate the positions of the non-solution atoms in the original array. Here, an additional subscript in the original array needs to be stored. This subscript can be obtained by traversing the surface area without additional memory consumption. The receiving process updates the received non-solution atom information to the ghost area according to the subscript, and the atoms in other positions of the ghost area are regarded as solution atoms. It can be seen that after using the compressed storage communication method, the communication results are the same as the communication results of the existing communication mode, and the receiving process can correctly receive the data.
[0065] Step S104, after the previous three steps, since the compressed storage algorithm does not store the information of solution atoms, its method of querying atomic information is different from the existing storage mode. If you need to determine the type of atom on a lattice point, you must first query whether it exists in the hash table of each non-solution atom. The algorithm for querying atomic information is as follows: Figure 6 As shown, i represents the type of solute atom, and M represents the number of solute atom types.
[0066] The query algorithm is as follows:
[0067] (1) According to the local coordinates of the queried atom, calculate the corresponding local ID.
[0068] (2) Check whether the local id exists in the hash table of solute i atom. If the local id exists in the hash table, the atom type is determined to be solute i and the query ends. If not, add 1 to i and repeat (2) until the hash table of a solute atom is found or the hash tables of all solute atoms are searched.
[0069] (3) If the local ID does not exist in the solute hash table, then check whether the local ID exists in the vacancy hash table. If so, the type of the atom is determined to be a vacancy. If not, the type of the atom is determined to be a solution atom.
[0070] The embodiment of the present invention analyzes the reason why the memory consumption of existing software using the AKMC method for material radiation damage simulation is generally very large, and adopts a multi-level compression storage method to achieve storage compression and communication volume compression. In addition, the effect experiment of the multi-level compression storage method is carried out on the CPU. Here, it is assumed that the solute concentration of the experimental simulation environment is 1.34*10 -2 , the vacancy concentration is 8*10 -6, the maximum available memory is 100GB. The actual effect of the present invention is verified by continuously expanding the total number of atoms, and the experimental results are shown in Table 1. The compression ratio in the table is equal to the memory consumption of the existing storage mode divided by the memory consumption after compressed storage.
[0071] Table 1
[0072] Total number of atoms Memory usage of existing storage mode (GB) Memory consumption after storage of the present invention (GB) Compression ratio <![CDATA[2.16*10 8 ]]> 6.6 0.17 38.82 <![CDATA[5.12*10 8 ]]> 15.5 0.32 48.44 <![CDATA[10 9 ]]> 30.2 0.58 52.07 <![CDATA[2.74*10 9 ]]> 82.5 1.7 48.53
[0073] It can be seen that the compression storage method of the present invention has very good performance. Compared with the existing storage mode, the multi-level compression storage method can greatly reduce the consumption of memory, and its compression ratio can reach 52.07.
[0074] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A multi-level compression storage method for AKMC simulation of radiation damage, characterized in that: The following steps are involved: Step 1: For all processes started by AKMC simulation, the number of solute atoms and the number of vacancies assigned to the current process are determined according to the set total number of solutes, total number of vacancies, and the process number of the process in the Cartesian communication domain; Step 2: Each process generates a corresponding number of local IDs according to the number of solute atoms and vacancies allocated, and stores the local IDs as keys in the corresponding solute hash table and vacancy hash table; Step 3: Each process synchronizes the non-solution atom information in its surface area to the ghost area corresponding to the neighboring process through MPI communication; Step 4: Calculate the local ID based on the local coordinates, and then use the local ID to query each hash table to determine the atom type corresponding to the local coordinates.
2. The multi-level compression storage method for AKMC simulation of radiation damage according to claim 1 is characterized in that: The specific process of step 1 is: 1.
1. Each process reads the configuration file to obtain the total number of solutes and total number of vacancies in the current simulation environment; 1.
2. Each process is divided evenly, that is, the total number of solutes and the total number of vacancies are calculated divided by the total number of processes; if the divisor has a remainder, the remainder is evenly distributed according to the process number in the Cartesian communication domain, that is, the number of solutes and vacancies allocated to the first remainder processes is increased by one.
3. The multi-level compression storage method for AKMC simulation of radiation damage according to claim 2 is characterized in that: In step 2, the local IDs of vacancy atoms are stored in the vacancy hash table, and the local IDs of solute atoms are stored in the solute hash table.
4. The multi-level compression storage method for AKMC simulation of radiation damage according to claim 3 is characterized in that: The specific process of step three is: 3.
1. Design the structure of compressed communication. The structure array of compressed communication will be transmitted during MPI communication. The structure of the compression communication is: subscript, atom type; wherein the subscript indicates the position of the non-solution atom in the original integer array, and the atom type indicates which type of solute atom or vacancy atom the non-solution atom is; 3.
2. Use the compression storage algorithm to transmit the surface area data to the neighboring process.
5. The multi-level compression storage method for radiation damage AKMC simulation according to claim 4 is characterized in that: The compression storage algorithm is specifically: 3.2.
1. Traverse all the data in the surface area of the first dimension and add the subscripts and atom types of non-solution atoms to the sending buffer; 3.2.
2. Each process transmits the data in the send buffer to the neighboring process in the first dimension; 3.2.
3. Each process receives the data sent from the neighbor process into the receiving buffer; 3.2.
4. Traverse the data in the receiving buffer and update the corresponding non-solution atom type data in the ghost area according to the subscript; 3.2.
5. Treat the data at other locations in the ghost area as solution atoms and update and synchronize them; 3.2.
6. Repeat 3.2.1 to 3.2.5 until the surface area data of all dimensions are synchronized.
6. The multi-level compression storage method for AKMC simulation of radiation damage according to any one of claims 1 to 5, characterized in that: The specific process of using the local ID to query each hash table and determine the atom type corresponding to the local ID is as follows: Check whether the local ID is in the vacant hash table. If it is, the query ends and the atom is determined to be a vacant atom. If the local ID is not in the empty hash table, check whether the local ID is in the hash table of solute type one. If it is, the query ends and the atom is determined to be solute one atom. If it is not, repeat 4.3.2 until the hash table of a solute atom is found or all solute hash tables are searched. If there is no key of the local ID in all solute hash tables and vacancy hash tables, the atom is judged to be a solution atom.
