A parallel reading method based on CGNS hybrid grids

By adopting a parallel reading method based on CGNS hybrid grid in numerical simulation of aircraft engines, the difficulty of parallel computing caused by the storage of mixed grid topological information is solved, and efficient data reading and processing is realized, which is suitable for rapid iterative design and optimization.

CN119203641BActive Publication Date: 2025-05-27AERO ENGINE ACAD OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411102882.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2025-05-27
Estimated Expiration
2044-08-12

AI Technical Summary

Technical Problem

In numerical simulation of aircraft engines, the topological information storage method of hybrid grids leads to difficulty in parallel computing, and traditional single-process reading methods are difficult to meet the needs of efficient simulation, resulting in slow simulation speed.

Method used

Using a parallel reading method based on CGNS hybrid grid, each process calculates the upper and lower limits of read in accordance with the number of grid vertices, determines the grid topology through inter-process communication, and generates all possible grid topology until a unique network topology is found.

Benefits of technology

It significantly improves data reading and processing efficiency, avoids time bottlenecks in single-process reading methods, reduces the burden of redundant computing, and is suitable for engineering applications that are fast iterative design and optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119203641B_ABST
    Figure CN119203641B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of computational fluid dynamics, and in particular provides a parallel reading method based on CGNS hybrid grids, including the following steps: S1: Calculate the upper and lower limits that the process needs to read in according to the number of CGNS grid vertices, and each process reads in the grid data between the upper and lower limits of the process respectively; S2: Communicate the point information of the last n points of the previous process to the next process; after each process analyzes the points, determine which points may be grid cell type data as possible topological starting points; S3: Generate all possible grid topologies based on the set of possible topological starting points; S4: Determine the unique grid topology of other processes through communication according to the process with the determined grid topology information; repeat this loop until all processes find the unique network topology. The present disclosure significantly improves the efficiency of data reading and processing by parallel reading and processing CGNS hybrid grid data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of computational fluid dynamics (CFD), and particularly to a parallel reading method based on CGNS hybrid grids. Background Art

[0002] Computational Fluid Dynamics (CFD) is a technology used to simulate and analyze fluid flow, heat transfer, and other related physical phenomena. It is particularly important in aeroengine design because it can test and optimize engine performance in a virtual environment, thereby reducing the need and cost of physical tests. CGNS is a standard format for CFD data storage and exchange, and is widely used in the fields of aviation, aerospace, automotive, etc. to store large-scale grids and simulation data.

[0003] With the continuous expansion of the grid scale in aeroengine numerical simulation and the increasing application scenarios of hybrid grids due to complex configurations, since the topological lengths of each grid in the hybrid grid are inconsistent, the method of sequentially reading grid topologies from front to back is often adopted. Only by reading the topological information of the previous grid can the accurate starting position of the next grid topology information be determined, so as to ensure the complete reading of the topological information of a single grid. This grid topology storage method with a front-back dependency causes difficulties in grid partitioning in parallel computing, restricts the application of parallel computing, and the traditional single-process reading method is difficult to meet the requirements of efficient simulation, resulting in slow simulation speed and affecting the design and optimization process. Summary of the Invention

[0004] In view of the above problems, the present disclosure is proposed. The present disclosure provides a parallel reading method based on CGNS hybrid grids.

[0005] According to one aspect of the present disclosure, a parallel reading method based on CGNS hybrid grids is provided, including the following steps:

[0006] S1: Calculate the upper and lower limits that the process needs to read in according to the number of CGNS grid vertices, and each process reads in the grid data between the upper and lower limits of this process respectively;

[0007] S2: Communicate the last n point information of the previous process to the next process; after each process analyzes the points, determine which points may be grid cell type data as possible topological starting points;

[0008] S3: Start generating all possible grid topologies according to the set of possible topological starting points;

[0009] S4: According to the process that has determined the grid topology information, determine the unique grid topology of other processes through communication; repeat this cycle until all processes find the unique network topology.

[0010] In addition, the parallel reading method based on CGNS hybrid grid according to an aspect of the present disclosure further includes: S1 includes the following steps:

[0011] S11: Open the CGNS grid, determine that the node is a hybrid network; obtain the size of the file body point topology data;

[0012] S12: Each process calculates the upper and lower limits to be read by the current process according to the number of nodes, and reads the data into the data structure by calling the data reading interface of CGNS.

[0013] In addition, the parallel reading method based on CGNS hybrid grid according to an aspect of the present disclosure further includes: S2 includes the following steps:

[0014] S21: The current process obtains the missing point information from the previous process through communication. The previous process communicates the last points to the current process, and the number of points communicated is the maximum topological point number plus one;

[0015] S22: Establish a supported grid cell type code table;

[0016] S23: Loop to determine whether the communicated points exist in the grid cell type code table. If they exist, mark them as possibly topological starting points;

[0017] S24: Further optimize and screen all the points that have been marked as possible starting points. If the end of the topological points represented by the starting point is less than or equal to the end of the communicated points, it means that the topology can be generated in the previous process, and re-mark it as a non-starting point;

[0018] S25: After the screening is completed, loop through the possible topological starting points to generate the grid topology.

[0019] In addition, the parallel reading method based on CGNS hybrid grid according to an aspect of the present disclosure further includes: S3 includes the following steps:

[0020] S31: Loop through all the starting positions. In each loop, insert the points in front of the process points, communicate the end point position to the next process. If the end point position has not been determined, the communication is reduced by 1;

[0021] S32: The process receives the end point position from the previous process; if it is not reduced by 1, update the start position of this process; the start position of this process is the end position of the previous process plus 1; check whether this position has been calculated. If it has been calculated, directly save the topology and update the end point of the current process;

[0022] S33: If the position is determined and the topology has not been generated, directly jump to the determined starting position to start the calculation;

[0023] S34: If the starting position is not determined, attempt to generate the topology of the current loop; if an illegal number appears at a grid type point, this possible starting point can be considered incorrect and skipped directly; if generation continues until the end of the points, save temporarily.

[0024] S35: Before the end of each loop, confirm whether there is only one possible grid topology in the process. If there is only one, directly save the unique grid topology and then update the known starting point and known ending point of this process; if there are multiple, repeat steps S31 - S35.

[0025] In addition, the parallel reading method based on CGNS hybrid grids according to an aspect of the present disclosure further includes: S3 further includes the following steps:

[0026] S36: When all loops end and there are still multiple possible grid topologies in the process, inter - process communication is required to further select the correct network topology order.

[0027] In addition, the parallel reading method based on CGNS hybrid grids according to an aspect of the present disclosure further includes: The illegal number refers to a number not in the grid cell type code table.

[0028] In addition, the parallel reading method based on CGNS hybrid grids according to an aspect of the present disclosure further includes, S4 includes the following steps;

[0029] S41: When there are multiple possible grid topologies in a process, that is, when some processes fail to update the known starting point and known ending point, communication is required to determine the correct topology.

[0030] S42: The previous process communicates the known ending point of this process to the current process.

[0031] S43: Update the known starting point of the current process by adding 1 to the known ending point of the previous process.

[0032] S44; Repeat the loop process until all processes in the entire mesh division process domain have updated the known starting point and known ending point, that is, find the unique correct topology; when all position information is determined, end the loop.

[0033] In addition, the parallel reading method based on CGNS hybrid grids according to an aspect of the present disclosure further includes: The known ending point in S42 refers to the data at the position of the previous process in the mesh ending point array.

[0034] In addition, the parallel reading method based on CGNS hybrid grids according to an aspect of the present disclosure further includes: When the known ending point of the previous process in S43 is not decreased by 1, use the known ending point of the previous process plus 1 as the starting point of the current process.

[0035] Compared with the prior art, the present disclosure has the following beneficial effects:

[0036] 1. By reading and processing CGNS hybrid grid data in parallel with multiple processes, the present disclosure significantly improves the efficiency of data reading and processing. In the multi-process method, each process is responsible for reading and processing a part of the grid data, avoiding the time bottleneck caused by excessive data volume in the single-process reading method and the problem that the upper and lower limits of data reading by parallel computing processes could not be used originally when processing hybrid grids.

[0037] 2. The present disclosure not only improves the data reading efficiency, but also reduces the burden of redundant calculations of a single process through a large amount of communication processing between parallel processes, which is of great significance for engineering applications that require rapid iterative design and optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] By describing the embodiments of the present disclosure in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present disclosure will become more obvious. The drawings are used to provide a further understanding of the embodiments of the present disclosure, and constitute a part of the specification, and are used to explain the present disclosure together with the embodiments of the present disclosure, and do not constitute a limitation to the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.

[0039] Figure 1 is a comparison between a single grid topology node and a hybrid grid topology node.

[0040] Figure 2 is a flowchart of a parallel reading method based on CGNS hybrid grids according to an embodiment of the present disclosure.

[0041] Figure 3 is an efficiency comparison when different processes process the same grid in parallel.

[0042] Figure 4 is the specific implementation steps of S1.

[0043] Figure 5 is the specific implementation steps of S2.

[0044] Figure 6 is an example process display of S2.

[0045] Figure 7 is the specific implementation steps of S3.

[0046] Figure 8 is an example process demonstration of S3.

[0047] Figure 9 is the specific implementation steps of S4.

[0048] Figure 10This is a demonstration of the S4 example process. Detailed implementation manners

[0049] In order to make the objectives, technical solutions and advantages of the present disclosure more apparent, exemplary embodiments according to the present disclosure will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all embodiments of the present disclosure. It should be understood that the present disclosure is not limited by the exemplary embodiments described herein.

[0050] When the grid file node is a CGNS hybrid grid, the topological information of each grid includes two parts of information: the grid cell type code and the global numbers of all vertices of the grid cell. The grid cell type code indicates the number of vertices and the topological order of the vertices of the subsequent grid. The two types of points appear in the form of grid cell type code, point 1, point 2, point 3, point 4,.... The number of vertices following different grid cell type codes is also different. For the comparison between a single grid topology node and a hybrid grid topology node, please refer to the appendix Figure 1 . The figure includes an example comparison of the single grid topology and the hybrid grid topology in the CGNS file. The upper part shows the writing form of the single grid type. In the example in the figure, a tetrahedral grid is taken as an example: the first four vertices (1, 2, 3, 4) belong to the first grid, and the last four vertices (5, 6, 7, 8) belong to the second grid. The lower part shows the writing format of the hybrid grid, where: 10 in the first digit represents a tetrahedral grid, followed by four vertices (1, 2, 3, 4). 14 represents a hexagonal prism grid, followed by 6 vertices (5, 6, 7, 8, 9, 10). Since the last digit 10 is still within the range of the 6 vertices represented by 14, its meaning is the vertex numbered 10, rather than the type information of the next tetrahedral grid. It can be seen that due to the different grid types that may appear at each position in the hybrid grid, the topological length and order of each grid are strongly related to the grid type information points.

[0051] The present disclosure further conceives and implements an efficient parallel reading strategy to solve this situation. This strategy aims to reduce the possibility of the grid topology information arrangement in each process through a large amount of inter-process communication during the process of each process trying to find the correct topological arrangement of the grid, so as to minimize the loss of topological relationship calculation time caused by multiple possibilities. Specifically as follows:

[0052] The present disclosure provides a parallel reading method based on a CGNS hybrid grid, including the following steps as shown in Figure 2 、 Figures 4 - 9 shown:

[0053] S1: Calculate the upper and lower limits that the process needs to read according to the number of CGNS grid vertices. Each process reads the grid data between the upper and lower limits of this process respectively. Different from the reading of a single grid type, this method does not consider the number of computational grid cells and the possible grid cell types contained during reading. Instead, each process directly calculates the number of data that each process needs to read according to the principle of equal data volume division based on the size of the entire grid file body point topology data, so as to ensure that the data volume processed by each process is consistent to the greatest extent. Specifically, S1 includes the following steps for reference Figure 4 as shown in

[0054] S11: Open the CGNS grid and determine that the node is a hybrid network; obtain the size of the file body point topology data. Use the reading interface of the CGNS to read the HDF5 built-in file format, scan the body point topology information of the current grid file, and check whether the grid topology type is a hybrid network. Each process obtains the total number of this grid topology.

[0055] S12: Each process calculates the upper and lower limits that the current process needs to read according to the number of nodes, and reads the data into the data structure by calling the data reading interface of CGNS. Set the size of this communication domain in MPI according to the number of processes for dividing the grid. Calculate the number of points of the grid topology data that each process needs to read and the upper and lower limits according to the size of the communication domain for dividing the grid. For example, when there are a total of 20 points (grid type information or grid vertices) in the grid topology information and the number of processes for dividing the grid is 2, the number of process 0 is 10, the lower limit is 1, and the upper limit is 10 (need to read grid points 1 - 10), and the number of process 1 is 10, the lower limit is 11, and the upper limit is 20 (need to read grid points 11 - 20).

[0056] S2: Communicate the last n point information of the previous process to the next process; after each process analyzes the points, determine which points may be grid cell type data as possible topological starting points; since each process directly reads a fraction of the point data of the grid topology data, and due to the pre-computation error between processes caused by the inconsistent length of each grid cell in the hybrid grid. This method uses the inter-process communication mechanism based on MPI to obtain the missing information. Its communication logic is: when the program calls the processes from 0 to n to read the grid, communicate the last m topological points read by this process to the next process. Among them, the last process does not communicate. The size of m depends on the largest number of nodes + 1 in the topological structure contained in this file ( Figure 2 for example, the number of points that need to be communicated is 6 + 1 = 7). Each process determines whether this point is a possible topological starting point by analyzing whether this point is in the supported grid type table. Specifically:

[0057] S2 includes the following steps for reference Figure 5As shown:

[0058] S21: The current process obtains the point information missing from the previous process through communication. The previous process communicates the points at the end to the current process, and the number of communicated points is the maximum number of topological points plus one. First, each process determines the number of points to be communicated (hereinafter referred to as transfer points). The length of the points needs to ensure that there is at least one point that can be used as a starting point (grid type point) among the transferred points, so as to ensure that there is no missing topology between processes. Therefore, the number of communicated points is the maximum value of the number of topological points represented by the topological type in the topological information plus one. Save the transferred data points separately, create a boolean array of possible starting points with the same length according to the length of the transferred data, known starting points (with a length equal to the number of grid division processes, default value is -1), and known ending points (with a length equal to the number of grid division processes, default value is -1). When the unique topology (which is also the correct topology) is determined, the known starting points and known ending points save the starting position and ending position of each process when the correct topology is present.

[0059] S22: Establish a table of supported grid cell type codes. Before judging the communicated data points, it is necessary to first establish a table of supported grid cell type codes for this calculation. The supported type table depends on the solver itself. The CGNS document provides all supported grid topology types and their numbers. In this method, tetrahedron (number 10 in CGNS) and hexahedron (number 14 in CGNS) will be used as examples.

[0060] S23: Loop to judge whether the communicated points exist in the grid cell type code table. If they exist, mark them as possible topological starting points. Cross-compare the data points in S21 with the grid cell type code table in S22. If the data points in S21 exist in the data table in S22, it is determined that this point is a possible starting point, and change the value at this position in the possible starting boolean array to true.

[0061] S24: Further optimize and screen all points that have been marked as possible starting points. If the end of the topological point represented by the starting point is less than or equal to the end of the communicated points, it means that this topology can be generated in the previous process, and re-mark it as a non-starting point. Since each process uses the idea of the greedy algorithm to save the grid topology, that is, each process reads as many point data as possible and then generates a topology until the last grid topology is split by two processes (the number of points represented by the last grid type data is greater than the remaining points of this process). This means that the communicated points cannot include the topology of a complete grid, otherwise duplicate topology data will be saved in the two processes. Based on this concept, optimize and screen all points that have been marked as possible starting points. If the end of the topological point represented by the starting point is less than or equal to the end of the communicated points, it means that this topology can be generated in the previous process. Re-mark it as a non-starting point.

[0062] S25: After the screening is completed, the possible topological starting points will be looped through to generate the mesh topology. If, after the screening is completed, there is no position in the transfer points marked as true in the possible starting point boolean array, it means that the starting point is exactly the starting position of the original points. If one or more are marked as starting points, then the following loop will be carried out to generate all possible mesh topologies.

[0063] As Figure 6 shown, taking the number of mesh division processes as 2, process 0 and process 1. The supported mesh formats are 10 and 14, namely tetrahedron and hexahedron. First, S21 calculates the number of mesh nodes to be transferred. Since 14 represents that 6 point serial numbers follow, in order to ensure that there is at least one starting position in the transfer points, 7 points need to be communicated to process 1, as Figure 6 the bold part in is the communicated points. S22 further creates a mesh cell type code table according to the supported mesh types, including 10 and 14. In S23, by looping through the transferred point array and comparing it with the mesh cell type code table, it is initially determined which points may be starting points. As Figure 6 shown, the third number is 10, which exists in the mesh cell type code table, so the third position in the possible starting boolean array is temporarily marked as true. In S24, in order to optimize the use of logic and efficiency, all possible starting positions need to be judged. After judgment, it is found that the starting position 3 is 10, and the number of points it represents is 4, which is exactly equal to the length of the transfer array (the end of the topological points represented by the starting point is less than or equal to the end of the communicated points), meeting the optimization condition, so the topology of this mesh does not need to be generated, and the position of 3 in the possible starting boolean array is marked as negative again. After the screening is completed, as shown in S25, since there is no possible starting position in the transfer nodes, it is judged that the starting position in the originally read points is the real starting position of the mesh topology. Mark the known starting position as the starting position of the original point information.

[0064] S3: Start generating all possible grid topologies based on the set of possible topological starting points; each process attempts to generate a grid topology structure according to the possible starting positions. The process will judge each possible starting position and generate the corresponding grid topology. During the attempt to generate, illegal topologies are filtered. The criterion for judging whether a point is illegal is as follows: when generating the grid topology, a node that does not belong to the CGNS grid type appears at the position of the grid type data point (not present in the pre-generated supported grid type table). When a certain grid type data point is illegal, it can be immediately confirmed that this starting position is not the correct topological starting position, and it can be directly skipped. This step ensures that even if the initial position is inaccurate, the process can still find the correct topological structure through multiple attempts, while greatly optimizing the time to find the correct topology. In extreme cases, the process may still have multiple possible topological structures at the end. The specific implementation method is as follows, see Figure 7 as shown:

[0065] S31: Loop through all the starting positions. In each loop, insert the point in front of the process point, communicate the end point position to the next process. If the end point position has not been determined, communicate -1; if the unique starting position of this process has been determined, it can be considered that this starting position must be correct, and then the points from the starting position to the end in the transfer point can be directly inserted in front of the points of this process. Communicate the end point position to the next process. If the end point position has not been determined, communicate -1.

[0066] S32: The process receives the end point position from the previous process; if it is not -1, update the starting position of this process; the end position of the previous process + 1 is the starting position of this process; check whether this position has been calculated. If it has been calculated, directly save the topology and update the end point of the current process;

[0067] S33: If the position is determined and the topology has not been generated, directly jump to the determined starting position to start the calculation (mark the other possible starting positions in the transfer point as negative);

[0068] S34: If the starting position is not determined, attempt to generate the topology of the current loop; if an illegal number appears at the grid type point, it can be considered that this possible starting point is incorrect and can be directly skipped; if it is generated until the end of the point, save it temporarily. If a number that is not in the grid cell type code table appears at the topology type point, it is considered illegal and this situation can be directly discarded. In the experiments of engineering examples, generally, illegal points can be detected within a few grid topologies generated, and then it can be confirmed whether this starting position is correct.

[0069] S35: Before the end of each loop, confirm whether there is only one possible grid topology in the process. If there is only one, directly save the unique grid topology and then update the known start point and known end point of this process; if there are multiple, repeat steps S31 - S35.

[0070] S36: When all loops end and there are still multiple possible grid topologies in the process, inter - process communication is required to further select the correct network topology order.

[0071] Take an example to further illustrate step S3. Refer to Figure 8 As shown, process 0 transfers 7 information points to process 1. After looping through all the transfer points, it is found that the possible start points are the second one (14) among the transfer points and the first one (10) among the process points. Communication starts in S31 - S32. Since the communication fails to determine the unique start position, by looping through each possible start position, grid topologies are constructed respectively. In S34, it is found that after constructing a grid topology with start point 1 (14), the next grid type point is 11, which is not in the added support grid cell type code table, so it is considered illegal and this possibility can be ended in advance and skipped directly. The second possible point may generate the complete grid topology of the whole process, so this possibility is retained. In S35, after confirming that there is only one grid topology in this process, the known start point and known end point are updated.

[0072] S4: Based on the process with the determined grid topology information, determine the unique grid topology of other processes through communication; repeat this loop until all processes find the unique network topology. When all processes have generated their respective grid topologies, according to the number of possible topologies generated by each process, judge whether inter - process communication is needed to determine which process generates the correct topology. If there are indeed multiple possible topological structures, the process will conduct further communication and confirm by combining the overall grid data to ensure the finally selected correct topological structure. When each process has only one grid topology, it is considered that the grid reading function has ended successfully. The specific method is as follows. Refer to Figure 9 as shown:

[0073] S41) When there are multiple possible grid topologies in a process, that is, when some processes fail to update the known start point and known end point, communication is needed to determine the correct topology. If there are still processes in the process that have not determined the correct grid topology, then it is judged that it is necessary to rely on inter - process communication to determine the correct grid topology, and communicate the information of the processes with the determined end points to the undetermined processes to help determine the grid topology.

[0074] S42) The previous process communicates the known end point of this process to the current process. Transmit the data at the position of the previous process in the grid end point array to the current process. If the data of the end point of the previous process is not -1, the end position of the previous process has been determined.

[0075] S43) Update the known end point of the previous process + 1 to the known start point of the current process. When the end point of the previous process is not -1, use the end point of the previous process + 1 as the start point of the current process. After determining the start point, compare the topologies that have been generated in the current process, and directly assign the topologies with the same start point as the correct ones. Discard all the remaining topology information.

[0076] S44) Repeat the loop process until the known start points and known end points of all processes in the entire grid division process domain are updated (find the only correct topology). When all position information is determined, end the loop.

[0077] As Figure 10 shown, the figure shows that the current number of grid division processes is 4, and the start and end point positions of processes 0, 2, and 3 have been determined. Since process 1 cannot be determined, process 0 communicates the known end point at position 0 to process 1. After process 1 obtains this information, it updates the known start point with 1 as the guide, selects the correct grid topology to save, and finally updates the known end point. Since the known start points and known end points of all processes have been confirmed at this moment, the loop is exited, and it is considered that the entire grid topology has been saved.

[0078] The advantages of the present disclosure are mainly reflected in the following two aspects:

[0079] Improve data reading and processing speed: Each process directly processes its own part of the CGNS grid data in memory to generate the topology structure required by the solver. Then, these processes write the generated topology files to the hard disk in parallel in binary form. In this way, when the same grid needs to be calculated next time, the generated topology file can be directly read without repeated calculation, thus significantly improving the data reading and processing speed.

[0080] Optimize resource utilization: Multi-process processing can make full use of the multi-core processing power of modern computers, allocate data reading tasks to different processing cores, and maximize the utilization rate of computing resources. The use of the vertex equalization strategy method not only improves the processing speed, but also minimizes the burden on a single process, enabling the system to run more efficiently.

[0081] Since the lengths of each grid cell in the mixed grid nodes of the CGNS file are inconsistent, it is difficult for traditional methods to pre-compute the length of data that each process needs to read. Through the above-mentioned refined segmentation strategy, the present invention ensures the accuracy and consistency of data reading, and avoids problems such as data loss or duplication.

[0082] The method of the present invention not only improves the data reading efficiency, but also reduces the burden of redundant calculations of a single process through a large number of communication processes during parallelization, which is of great significance for engineering applications that require rapid iterative design and optimization. With the continuous development of computing resources and the progress of parallel computing technology, the method of the present invention will be able to process large-scale data more flexibly and efficiently when performing numerical simulations of aeroengines. This is of great significance for improving simulation accuracy and speed, shortening the R & D cycle, and reducing costs, and provides strong technical support for the efficiency optimization of aeroengine simulations.

[0083] The present invention significantly improves the efficiency of data reading and processing by parallelly reading and processing CGNS mixed grid data through multiple processes. In the multi-process method, each process is responsible for reading and processing part of the grid data, avoiding the time bottleneck caused by excessive data volume in the single-process reading method and the problem that the upper and lower limits of data reading by parallel computing processes could not be used when processing mixed grids. The following is an analysis of the effects of this method in terms of time and space occupancy:

[0084] (1) Analysis of time occupancy:

[0085] Reading speed: By parallelly reading data through multiple processes and distributing large-scale data to multiple processes for parallel processing, the total time for data reading can be significantly reduced. Assuming that the single-process reading time is T, when using N processes, theoretically the reading time can be reduced to T / N. However, due to the overhead of inter-process communication and data integration, the actual time reduction may be slightly less than the theoretical value.

[0086] Topology generation time: After each process reads the data, it immediately generates a local grid topology structure, and these operations can be performed in parallel, thus further shortening the total time. Although there will be a certain communication overhead for the processes to determine the correct topology structure through communication, overall it is still faster than single-process processing.

[0087] (2) Analysis of space occupancy:

[0088] Memory usage: Each process processes part of the grid data and topology information in its memory, so sufficient memory is required to support multi-process operations. Each process will be evenly allocated according to the number of vertices of the overall grid file to each process, and the overall memory usage is more balanced compared to allocating according to the number of body point topologies of the overall grid file, better reducing the memory bottleneck during single-process processing.

[0089] Disk space: The generated topology files and solver data structures are stored on the hard disk in binary form. These files can be directly read during the next calculation without repeated calculation, thus saving storage space and calculation time.

[0090] As Figure 3 , it is the efficiency graph after implementing this method based on a domestic self-developed simulation software. Among them, when processing CGNS hybrid grids, the time taken to read a 6.05 million hybrid grid under different numbers of parallel cores and serial processing is mainly compared. This graph does not include the time required to generate the necessary topology of the solver, but only includes the time to store the topology in the grid file into memory. It can be seen that the time consumed by serial processing is about 17 seconds, and the time required to process the same file using 16 cores is about 2.19 seconds. By analyzing this efficiency graph, the parallel efficiency of the cores is approximately around 60% to 70%, which basically meets the expectations.

[0091] It should be noted that Figure 3 the efficiency graph shown in is the optimal case, that is, each process can directly determine the unique grid topology or skip this possibility directly when an illegal node appears during the generation of other grid topologies (see S3 in the overall process). In the worst case, a certain process will have m + 1 possible grid topologies as the starting positions, and the worst efficiency of a single process is O(m * T), where m is the number of transmitted nodes and T is the time required to completely generate the grid topology of one case. In this case, it is necessary to try to communicate the missing information to optimize the efficiency of the slowest process.

[0092] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be pointed out that the advantages, advantages, effects, etc. mentioned in the present disclosure are only examples and not limitations. It cannot be considered that these advantages, advantages, effects, etc. are essential for each embodiment of the present disclosure. In addition, the above-mentioned specific details are only for the purpose of illustration and easy understanding, rather than limitations. The above details do not limit the present disclosure to necessarily adopt the above specific details to implement.

[0093] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are only illustrative examples and do not intend to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open-ended words, meaning "including but not limited to", and can be used interchangeably with each other. The words "or" and "and" used here refer to the word "and / or", and can be used interchangeably with each other unless the context clearly indicates otherwise. The word "such as" used here refers to the phrase "such as but not limited to", and can be used interchangeably with each other.

[0094] In addition, as used herein, "or" as used in a list of items beginning with "at least one" indicates a disjunctive list such that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Further, the phrase "exemplary" does not mean that the examples described are preferred or better than other examples.

[0095] It should also be noted that in the systems and methods of the present disclosure, the various components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present disclosure.

[0096] Various changes, substitutions, and alterations to the techniques described herein can be made without departing from the teachings of the technology defined by the appended claims. In addition, the scope of the claims of the present disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and acts described above. Current or later-developed processes, machines, manufactures, compositions of events, means, methods, or acts that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Accordingly, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or acts within their scope.

[0097] The foregoing description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the present disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0098] The foregoing description has been presented for purposes of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the form disclosed herein. Although numerous example aspects and embodiments have been discussed above, those skilled in the art will recognize some of their variations, modifications, alterations, additions, and subcombinations.

Claims

1. A parallel reading method based on CGNS hybrid grid, characterized in that: The following steps are involved: S1: According to the number of CGNS mesh vertices, the upper and lower limits that need to be read by the calculation process are calculated, and each process reads the mesh data between the upper and lower limits of the process respectively; S2: Communicate the last n points of the previous process to the next process; after each process analyzes the points, it determines which points may be grid cell type data as possible topological starting points; S3: starting to generate all possible grid topologies based on a set of possible topology starting points; S4: According to the process that has determined the grid topology information, determine the unique grid topology of other processes through communication; repeat this cycle until all processes find the unique network topology; S3 includes the following steps: S31: loop all starting positions, insert the point in front of the process point in each loop, communicate the end point position to the next process, if the end point position has not been determined, communicate -1; S32: The process receives the end point position from the previous process; if it is not -1, the starting position of this process is updated; the end point position of the previous process + 1 is the starting position of this process; check whether the end point position received from the previous process has been calculated, if it has been calculated, directly save the topology and update the end point position of the current process; S33: If the end point position is determined and the topology has not been generated, directly jump to the determined start position to start calculation; S34: if the starting position is not determined, try to generate the topology of the current cycle; if an illegal number appears on the grid type point, it can be considered that the possible topology starting position is wrong and skipped directly; if the generation continues until the end of the point, it is temporarily saved; S35: Before each loop ends, confirm whether there is only one possible mesh topology in the process. If there is only one, directly save the unique mesh topology and update the known starting position and known ending point position of the process; if there are multiple, repeat steps S31-S35.

2. The parallel reading method based on CGNS hybrid grid according to claim 1, characterized in that: S1 includes the following steps: S11: Open the CGNS grid and determine that the node is a hybrid network; obtain the size of the file volume point topology data; In S12, each process calculates the upper and lower limits that the current process needs to read based on the number of nodes, and reads the data into the data structure by calling the CGNS data reading interface.

3. The parallel reading method based on CGNS hybrid grid according to claim 1, characterized in that: S2 includes the following steps: S21: The current process obtains the missing point information from the previous process through communication. The previous process communicates the last point to the current process. The number of points communicated is the maximum number of topological points plus one. S22: Establishing a supported grid unit type code table; S23: looping to determine whether the communicated point exists in the grid unit type code table, and if so, marking it as a possible topology starting point; S24: further optimize and screen all the topology starting points that have been marked as possible. If the end of the topology point represented by the starting point is less than or equal to the end of the communication point, it means that the topology can be generated in the previous process and re-marked as a non-starting point; S25: After the screening is completed, the possible topology starting points are looped to generate a mesh topology.

4. The parallel reading method based on CGNS hybrid grid according to claim 3, characterized in that: S3 also includes the following steps: S36: When all loops are completed, there are still multiple possible mesh topologies in the process, and communication between processes is required to further select the correct network topology order.

5. The parallel reading method based on CGNS hybrid grid according to claim 4, characterized in that: The illegal number refers to a number that is not in the grid unit type code table.

6. The parallel reading method based on CGNS hybrid grid according to claim 1, characterized in that: S4 includes the following steps: S41: When there are multiple possible mesh topologies in a process, that is, when some processes fail to update the known starting position and the known ending point position, communication is required to determine the correct topology; S42: Communicate the known end point position of the previous process to the current process; S43: adding 1 to the known end point position of the previous process and updating it to the known starting position of the current process; S44; repeat the loop process until all processes in the entire mesh division process domain have updated the known starting position and the known ending point position, that is, the only correct topology is found; when all the position information is determined, end the loop.

7. The parallel reading method based on CGNS hybrid grid according to claim 6, characterized in that: The known end point in S42 refers to the data of the previous process position in the grid end point array.

8. The parallel reading method based on CGNS hybrid grid according to claim 7, characterized in that: When the known end point of the previous process in S43 is not -1, the known end point of the previous process is incremented by 1 as the starting point of the current process.

Citation Information

Patent Citations

  • Grid parallel reading method and device, terminal equipment and readable storage medium

    CN116820772A