Parallel reading method based on GNNS hybrid grid
By adopting the parallel reading method of CGNS hybrid grid in computational fluid mechanics, using inter-process communication and data allocation, the problem of low reading efficiency caused by inconsistent topology length of the hybrid grid is solved, and efficient data processing and simulation are achieved Speed increases.
Patent Information
- Application Number
- CN202411102882.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-08-12
AI Technical Summary
In computational fluid mechanics, as the scale of the aero engine numerical simulation grid expands and the complexity of the complexity increases, the topological length of the hybrid grid is inconsistent, making it difficult for traditional single-process reading methods to meet the needs of efficient simulation, affecting the design and optimization process.
Using a parallel reading method based on CGNS hybrid grid, through inter-process communication and data allocation, each process reads the grid data separately, and by generating and filtering the grid topology, ensuring that all processes find a unique network topology.
It significantly improves data reading and processing efficiency, reduces the burden of redundant calculations for single-processes, is suitable for rapid iterative design and optimization, and improves the efficiency of aero engine simulation.
Smart Images

Figure CN119203641A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computational fluid dynamics (CFD) technology, and in particular to a parallel reading method based on a CGNS hybrid grid. 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 aerospace engine design because engine performance can be tested and optimized in a virtual environment, thereby reducing the need and cost of physical testing. CGNS is a standard format for CFD data storage and exchange, widely used in aviation, aerospace, automotive and other fields for storing large-scale grids and simulation data.
[0003] With the continuous expansion of grid scale in numerical simulation of aero-engines and the complex configuration, the application scenarios of hybrid grids are increasing. Since the topological length of each grid in the hybrid grid is inconsistent, the grid topology is often read from front to back. Only by reading the previous grid topology information can the accurate starting position of the next grid topology information be determined, so as to ensure the complete reading of a single grid topology information. This grid topology storage method with forward and backward dependencies has caused difficulties in grid partitioning in parallel computing, restricting the application of parallel computing. The traditional single-process reading method is difficult to meet the needs of efficient simulation, resulting in slow simulation speed and affecting the design and optimization process. Summary of the invention
[0004] The present disclosure is proposed in view of the above problems. The present disclosure provides a parallel reading method based on CGNS hybrid grid.
[0005] According to one aspect of the present disclosure, a parallel reading method based on a CGNS hybrid grid is provided, comprising the following steps:
[0006] 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;
[0007] 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;
[0008] S3: starting to generate all possible mesh topologies based on the set of possible topology starting points;
[0009] S4: According to the process that has determined the mesh topology information, determine the unique mesh 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 the CGNS hybrid grid according to one aspect of the present disclosure further includes: S1 includes the following steps:
[0011] S11: Open the CGNS grid and determine that the node is a hybrid network; obtain the size of the file volume point topology data;
[0012] 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.
[0013] In addition, the parallel reading method based on the CGNS hybrid grid according to one 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 point to the current process. The number of points communicated is the maximum number of topological points plus one.
[0015] S22: Establishing a supported grid unit type code table;
[0016] 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;
[0017] S24: further optimize and screen all the possible starting points that have been marked. 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;
[0018] S25: After the screening is completed, the possible topology starting points are looped to generate a mesh topology.
[0019] In addition, the parallel reading method based on the CGNS hybrid grid according to one aspect of the present disclosure further includes: S3 includes the following steps:
[0020] S31: loop all the revelation positions, insert the point in front of the process point in each loop, and 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 minus 1, update the start position of this process; the end position of the previous process plus 1 is the start position of this process; check whether the 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 calculation;
[0023] 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 this may be an error in the starting point and skipped directly; if the generation continues until the end of the point, it is temporarily saved;
[0024] 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 point and known ending point of the process; if there are multiple, repeat steps S31-S35.
[0025] In addition, the parallel reading method based on the CGNS hybrid grid according to one aspect of the present disclosure further includes: S3 also includes the following steps:
[0026] 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.
[0027] In addition, the parallel reading method based on the CGNS hybrid grid according to one aspect of the present disclosure further includes: the illegal number refers to a number that is not in the grid unit type code table.
[0028] In addition, the parallel reading method based on the CGNS hybrid grid according to one aspect of the present disclosure further includes that S4 includes the following steps;
[0029] S41: When there are multiple possible mesh topologies in a process, that is, when some processes fail to update the known start point and the known end point, communication is required to determine the correct topology;
[0030] S42: the previous process communicates the known end point of the process to the current process;
[0031] S43: Update the known end point of the previous process + 1 as the known start point of the current process;
[0032] S44; repeat the loop process until all processes in the entire mesh division process domain have updated the known starting point and the known ending point, that is, the only correct topology is found; when all the position information is determined, the loop ends.
[0033] In addition, the parallel reading method based on the CGNS hybrid grid according to one aspect of the present disclosure further includes: the known end point in S42 refers to the data of the previous process position in the grid end point array.
[0034] In addition, the parallel reading method based on the CGNS hybrid grid according to one aspect of the present disclosure further includes: when the known end point of the previous process in S43 is not minus 1, the known end point of the previous process is increased by 1 as the starting point of the current process.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] 1. The present invention significantly improves the efficiency of data reading and processing by reading and processing CGNS hybrid mesh data in parallel through multiple processes. In the multi-process method, each process is responsible for reading and processing part of the mesh 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 cannot be used in parallel computing processes when processing hybrid meshes.
[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 parallel communication processing, which is of great significance for engineering applications that require rapid iterative design and optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0039] Figure 1 It is a comparison between single mesh topology nodes and hybrid mesh topology nodes.
[0040] Figure 2 is a flowchart illustrating a parallel reading method based on a CGNS hybrid grid according to an embodiment of the present disclosure.
[0041] Figure 3 It is a comparison of the efficiency when different processes process the same grid in parallel.
[0042] Figure 4 These are the specific implementation steps of S1.
[0043] Figure 5 These are the specific implementation steps of S2.
[0044] Figure 6 This is an S2 example flow display.
[0045] Figure 7 These are the specific implementation steps of S3.
[0046] Figure 8 It is an S3 example process demonstration.
[0047] Fig. 9 These are the specific implementation steps of S4.
[0048] Fig.10It is a demonstration of the S4 sample process. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present disclosure more obvious, the exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.
[0050] When the mesh file node is a CGNS hybrid mesh, the topology information of each mesh includes two parts of information: the mesh unit type code and the global number of all vertices of the mesh unit. The mesh unit type code indicates the number of vertices of the next mesh and the topological order of the vertices. Two types of points appear in the form of mesh unit type code, point 1, point 2, point 3, point 4... The number of vertices behind different mesh unit type codes is also different. For a comparison of single mesh topology nodes and hybrid mesh topology nodes, please see the attached Figure 1 . The figure contains an example comparison of single mesh topology and hybrid mesh topology in the CGNS file. The upper part shows the writing format of a single mesh type. The example in the figure takes a tetrahedral mesh as an example: the first four vertices (1, 2, 3, 4) belong to the first mesh, and the last four vertices (5, 6, 7, 8) belong to the second mesh. The lower part shows the writing format of a hybrid mesh, where: the first digit 10 represents a tetrahedral mesh, followed by four vertices (1, 2, 3, 4). 14 represents a hexagonal prism mesh, 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, it means the vertex numbered 10, not the type information of the next tetrahedral mesh. It can be seen that since the mesh types that may appear at each position in the hybrid mesh are different, the topological length and order of each mesh are strongly related to the mesh type information point.
[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 grid topology information arrangement in each process through a large amount of inter-process communication when each process tries to find the correct grid topology arrangement, so as to minimize the loss of topology relationship calculation time caused by multiple possibilities. The details are as follows:
[0052] The present disclosure provides a parallel reading method based on a CGNS hybrid grid, comprising the following steps: Figure 2 , Figure 4-Figure 9 As shown:
[0053] S1: According to the number of CGNS mesh vertices, the upper and lower limits that the process needs to read are calculated, and each process reads the mesh data between the upper and lower limits of the process; different from the reading of a single mesh type, this method does not consider the number of mesh units and the types of mesh units that may be included when reading. Instead, each process directly calculates the number of data that each process needs to read according to the principle of equal distribution of data based on the size of the entire mesh file body point topology data, so as to maximize the consistency of the amount of data processed by each process. Specifically, S1 includes the following steps. See Figure 4 As shown:
[0054] S11: Open the CGNS grid and determine that the node is a hybrid network; obtain the size of the file volume point topology data. Use the reading interface of the HDF5 built-in file format of CGNS to scan the volume point topology information of the current grid file and check whether the grid topology type is a hybrid grid. Each process obtains the total number of the grid topology.
[0055] 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 read interface. Set the size of this communication domain in MPI according to the number of processes that divide the grid. Calculate the number of points and upper and lower limits of the grid topology data that each process needs to read based on the size of the communication domain of the divided grid. For example, the grid topology information includes a total of 20 points (grid type information or grid vertices). When the number of processes that divide the grid is 2, the number of process 0 is 10, the lower limit is 1, and the upper limit is 10 (grid points 1-10 need to be read), and the number of process 1 is 10, the lower limit is 11, and the upper limit is 20 (grid points 11-20 need to be read).
[0056] S2: Communicate the last n point information of the previous process to the next process; after each process analyzes the points, it determines which points may be grid unit type data as possible topological starting points; because each process directly reads one-fifth of the point data of the grid topological data, and because the length of each grid unit in the mixed grid is inconsistent, the pre-calculation error between processes is caused. This method uses an MPI-based inter-process communication mechanism to obtain missing information. Its communication logic is: when the program calls processes from 0 to n to read the grid, the last m topological points read by the process are communicated to the next process. Among them, the last process does not communicate. The size of m depends on the maximum number of nodes in the topological structure contained in the file + 1 (with Figure 2 For example, the number of points that need to communicate is 6+1=7). Each process determines whether the point is a possible topology starting point by analyzing whether the point is in the supported grid type table. Specifically:
[0057] S2 includes the following steps reference Figure 5As shown:
[0058] S21: The current process obtains the missing point information from the previous process through communication, and the previous process communicates the last point to the current process, and the number of points communicated is the maximum number of topological points plus one. First, each process determines the number of points that need to be communicated (hereinafter referred to as transmission points). The length of the point needs to ensure that there is at least one point that can be used as the starting point (grid type point) among the transmitted points, thereby ensuring that there is no missed topology between processes. Therefore, the number of points communicated is the maximum number of topological points represented by the topological type in the topological information plus one. The transmitted data points are saved separately, and a Boolean array of possible starting points of the same length is created according to the length of the transmitted data. The starting point is known (the length is the number of grid division processes, the default value is -1), and the ending point is known (the length is the number of grid division processes, the default value is -1). When the unique topology (also the correct topology) is determined, the known starting point and the known ending point save the starting position and ending position of each process when the topology is correct.
[0059] S22: Establish a table of supported mesh unit type codes. Before judging the communication data points, it is necessary to first establish a table of mesh unit type codes supported by this calculation. The supported type table depends on the solver itself. The CGNS document provides all supported mesh 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 determine whether the communicated point exists in the grid unit type code table. If it exists, it is marked as a possible topological starting point. Cross-check the data point in S21 with the grid unit type code table in S22. If the data point in S21 exists in the data table in S22, it is determined that the point is a possible starting point, and the value of the possible start Boolean array at this position is changed to true.
[0061] S24: Further optimize and screen all possible starting points that have been marked. If the end of the topological 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 is re-marked as a non-starting point. Since each process uses the idea of a greedy algorithm to save the grid topology, that is, each process generates the topology after reading as much point data as possible 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 number of points remaining in the process). This means that the communication point cannot include a complete grid topology, otherwise duplicate topological data will be saved in the two processes. Based on this concept, all possible starting points that have been marked are optimized and screened. If the end of the topological 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. Re-mark as a non-starting point.
[0062] S25: After the screening is completed, the possible topology starting points will be looped to generate a mesh topology. If after the screening is completed, no position in the transmission point is marked as true in the possible starting point Boolean array, it means that the starting point is exactly the starting position of the original point. If there is one or more marked as starting points, then the next loop will be performed to generate all possible mesh topologies.
[0063] like Figure 6 As shown, the number of mesh division processes is 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 that need to be transmitted. Since 14 represents 6 point numbers followed by it, in order to ensure that there is at least one starting position in the transmission point, it is necessary to communicate to 7 points in process 1, such as Figure 6 The bold part is the communication point. S22 further creates a grid unit type code table according to the supported grid types, including 10 and 14. In S23, the point array transmitted in a loop is compared with the grid unit type code table to preliminarily determine which points may be the starting points. Figure 6 As shown in , the third number is 10, which exists in the grid unit type code table, so the third bit in the possible start 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 represented is 4, which is exactly equal to the length of the transmission array (the end of the topological point represented by the starting point is less than or equal to the end of the communication point). If the optimization conditions are met, there is no need to generate the topology of the grid, and the position 3 in the possible start Boolean array is re-marked as negative. After the screening is completed, as shown in S25, since there is no possible starting position in the transmission node, it is judged that the starting position in the original read-in point is the real starting position of the grid topology. Mark the known starting position as the starting position of the original point information.
[0064] S3: Based on the set of possible topological starting points, start generating all possible mesh topologies; each process attempts to generate a mesh topology structure based on the possible starting positions. The process will judge each possible starting position and generate the corresponding mesh topology. Illegal topologies are screened out during the generation attempt. The basis for judging whether a point is illegal is: when generating the mesh topology, a node that does not belong to the CGNS mesh type appears at the position of the mesh type data point (it does not exist in the pre-generated supported mesh type table). When a mesh type data point is illegal, it can be immediately confirmed that the starting position is not the correct topological starting position and is skipped directly. This step ensures that even if the initial position is inaccurate, the process can still find the correct topology 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. See the following for the specific implementation method. Figure 7 As shown:
[0065] S31: loop through all the revelation 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; if the only starting position of the process has been determined, it can be considered that this starting position must be correct, and the points from the starting position to the end of the transmission point can be directly inserted before the original point of the 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, the start position of this process is updated; the end position of the previous process + 1 is the start position of this process; check whether the 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 calculation (mark other possible starting positions in the transmission point with negative values);
[0068] 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 this may be an error in the starting point and skip it directly; if the generation continues until the end of the point, it is temporarily saved. If a number that is not in the grid unit type code table appears on the topology type point, it is considered illegal and can be directly discarded. In the experiment of engineering examples, illegal points can generally be detected within a few grid topologies, and then confirm whether the starting position is correct.
[0069] 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 point and known ending point of the process; if there are multiple, repeat steps S31-S35.
[0070] 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.
[0071] Step S3 is further described with an example. Figure 8 As shown, process 0 transmits 7 information points to process 1. After looping the entire transmission point, it is found that the possible starting point is the second one (14) in the transmission point and the first one (10) in the process point. Communication starts in S31-S32. Since the communication fails to determine a unique starting position, the grid topology is constructed by looping each possible starting position. In S34, it is found that after building a grid topology, the next grid type point is 11, which is not in the table of supported grid unit type codes that have been added. This is considered illegal and can be ended in advance and skipped directly. The second possible point may completely generate the grid topology of the entire process, that is, retain this possibility. In S35, after confirming that there is only one grid topology in this process, the known starting point and the known ending point are updated.
[0072] 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 a unique network topology. When all processes have generated their own grid topologies, determine whether inter-process communication is needed to determine which process has generated the correct topology based on the number of possible topologies generated by each process. If there are indeed multiple possible topologies, the process will further communicate and confirm by combining the overall grid data to ensure that the correct topology is finally selected. When each process has only one grid topology, it is considered that the grid reading function has been successfully completed. The specific method is as follows. Fig. 9 As shown:
[0073] S41) When there are multiple possible mesh topologies in a process, that is, when some processes fail to update the known start point and the known end point, communication is required to determine the correct topology. If there are still processes that fail to determine the correct mesh topology, it is determined that the correct mesh topology needs to be determined by communication between processes, and the process information of the determined end point is communicated to the uncertain process to help determine the mesh topology.
[0074] S42) The previous process communicates the known end point of the process to the current process. The data of the previous process position in the grid end point array is transmitted 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 as the known start point of the current process. When the end point of the previous process is not -1, the end point of the previous process + 1 is used 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 topology. The remaining topology information is discarded.
[0076] S44) Repeat the loop process until all processes in the entire meshing process domain have updated the known starting point and the known ending point (finding the only correct topology). When all position information is determined, the loop ends.
[0077] like Fig.10 As shown in the figure, the current number of meshing processes is 4, and processes 0, 2, and 3 have all determined the start and end point positions. Since process 1 cannot determine, process 0 communicates the known end point of position 0 to process 1. After process 1 obtains this information, it updates the known start point guided by position 1, selects the correct mesh topology to save, and finally updates the known end point. Since the known start and end points of all processes have been confirmed at this moment, the loop is exited, and it is considered that the entire mesh topology has been saved.
[0078] The advantages of this disclosure are mainly reflected in the following two aspects:
[0079] Improved data reading and processing speed: Each process processes its own portion of the CGNS mesh data directly in memory to generate the topology required by the solver. These processes then write the generated topology files to the hard disk in parallel in binary form. This way, when the same mesh needs to be calculated next time, the generated topology files can be directly read without repeating the calculation, which significantly improves data reading and processing speed.
[0080] Optimize resource utilization: Multi-process processing can fully utilize the multi-core processing power of modern computers, assign data reading tasks to different processing cores, and maximize the utilization of computing resources. The use of the vertex averaging strategy not only improves the processing speed, but also minimizes the burden of a single process, allowing the system to run more efficiently.
[0081] Since the length of each grid unit in the hybrid grid node in the CGNS file is inconsistent, it is difficult for the traditional method to pre-calculate the length of data that each process needs to read. The present invention ensures the accuracy and consistency of data reading through the above-mentioned refined segmentation strategy, avoiding the problem of 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 calculation of a single process through a large amount of parallel communication processing, which is of great significance for engineering applications that require rapid iterative design and optimization. With the continuous development of computing resources and the advancement 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 simulation of aircraft engines. 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 aircraft engine simulation.
[0083] The present invention significantly improves the efficiency of data reading and processing by reading and processing CGNS hybrid mesh data in parallel through multiple processes. In the multi-process method, each process is responsible for reading and processing part of the mesh 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 the data cannot be read using parallel computing processes when processing hybrid meshes. The following is an analysis of the effect of this method in terms of time and space occupation:
[0084] (1) Time occupancy analysis:
[0085] Reading speed: Multiple processes read data in parallel. By distributing large-scale data to multiple processes for parallel processing, the total time for data reading can be significantly reduced. Assuming that the reading time of a single process is T, when N processes are used, the reading time can theoretically 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 reading the data, each process immediately generates a local grid topology. These operations can be performed in parallel, further shortening the total time. The correct topology is determined through communication between processes. Although there is a certain communication overhead, it is still faster than single-process processing overall.
[0087] (2) Space occupancy analysis:
[0088] Memory usage: Each process processes part of the mesh 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 in the overall mesh file. The overall memory usage is more balanced than the volume point topology number allocation using the overall mesh file, which better reduces the memory bottleneck when processing a single process.
[0089] Disk space: The generated topology files and solver data structures are stored in binary form on the hard disk. These files can be read directly during the next calculation without repeated calculation, thus saving storage space and calculation time.
[0090] like Figure 3 , is an efficiency graph based on the implementation of this method in a domestically developed simulation software. Among them, the main comparison is the time taken to read a 6.05 million hybrid mesh under different numbers of parallel cores and serial when processing CGNS hybrid meshes. This graph does not include the time to generate the necessary topology for the solver, but only includes the time to store the topology in the mesh 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 core is about 60% to 70%, which is basically in line with 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 mesh topology or directly skip the possibility when generating other mesh topologies due to illegal nodes (see S3 of the overall process). In the worst case, a process will have m+1 possible mesh topologies as the starting position, and the worst efficiency of a single process is O(m*T), where m is the number of nodes transmitted and T is the time required to fully generate a mesh topology for a situation. In this case, it is necessary to try to communicate missing information to optimize the efficiency of the slowest process.
[0092] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0093] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0094] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so 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). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0095] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0096] Various changes, substitutions, and modifications of the techniques described herein may be made without departing from the teachings defined by the appended claims. Furthermore, 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 actions described above. Currently existing or later to be developed processes, machines, manufactures, compositions of events, means, methods, or actions that perform substantially the same functions or achieve substantially the same results as the corresponding aspects described herein may be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or actions within their scope.
[0097] The above 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 may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0098] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
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 mesh topologies based on the set of possible topology starting points; S4: According to the process that has determined the mesh topology information, determine the unique mesh topology of other processes through communication; repeat this cycle until all processes find the unique network topology.
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 possible starting points that have been marked. 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 1, characterized in that: S3 includes the following steps: S31: loop all the revelation positions, insert the point in front of the process point in each loop, and 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 start position of this process is updated; the end position of the previous process + 1 is the start position of this process; check whether the position has been calculated, if it has been calculated, directly save the topology and update the end point of the current process; S33: If the position is determined and the topology has not been generated, directly jump to the determined starting 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 this may be an error in the starting point 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 point and known ending point of the process; if there are multiple, repeat steps S31-S35.
5. The parallel reading method based on CGNS hybrid grid according to claim 4, 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.
6. 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.
7. 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 start point and the known end point, communication is required to determine the correct topology; S42: the previous process communicates the known end point of the process to the current process; S43: adding 1 to the known end point of the previous process and updating it as the known start point of the current process; S44; repeat the loop process until all processes in the entire mesh division process domain have updated the known starting point and the known ending point, that is, the only correct topology is found; when all the position information is determined, the loop ends.
8. The parallel reading method based on CGNS hybrid grid according to claim 7, characterized in that: The known end point in S42 refers to the data of the previous process position in the grid end point array.
9. 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 minus 1, the known end point of the previous process is incremented by 1 and used as the start point of the current process.
Citation Information
Patent Citations
Ocean data assimilation method and system based on high-performance parallel optimization
CN114546638A
Grid parallel reading method and device, terminal equipment and readable storage medium
CN116820772A
Matlab-based flexibility topological optimization method suitable for multiple types of grids
CN117875124A
Buffered coscheduling for parallel programming and enhanced fault tolerance
US20020083116A1
Special-Purpose Programmed Computer For Numerical Simulation Of A Metal Forming Process Having A Predefined Load Path With Corresponding Mesh Adjustment Scheme
US20190050504A1
Cited By
Grid file parallel processing method and device, computer equipment and storage medium
CN121029104A
Parallel processing methods, apparatus, computer equipment, and storage media for grid files
CN121029104B