A computing node load balancing method and device based on octree

Through the octree-based computing node load balancing method, the problem of load imbalance in the material point method simulation process is solved. Through recursive division and non-blocking communication, the load distribution is optimized, and efficient computing node load balancing and data transmission is achieved.

CN120012508BActive Publication Date: 2025-08-19COMP NETWORK INFORMATION CENT CHINESE ACADEMY OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510114440.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-08-19
Estimated Expiration
2045-01-24

AI Technical Summary

Technical Problem

During the material point method simulation process, as the simulation process progresses, changes in the calculation task of the subspace region lead to unbalanced load of the calculation task of each process, and frequent re-dividing of the space region leads to large calculation and communication overhead.

Method used

The octree-based computing node load balancing method is adopted to recursively divide the calculation area, build an octree structure, use spatial fill curves to allocate leaf nodes to the computing nodes, use depth-first search and dictionary sort to optimize load balancing, and adjust grid division between adjacent background grid processes, and use non-blocking communication and buffered arrays to optimize data transmission.

Benefits of technology

Dynamic equalization of load during the calculation process is realized, computing and communication overhead is reduced, computing efficiency is improved, and data transmission of adjacent sub-regions is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120012508B_ABST
    Figure CN120012508B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for balancing the load of computing nodes based on an octree, comprising dividing a computing area into multiple sub-areas, recursively dividing the computing area to obtain an octree structure corresponding to the computing area, and allocating leaf nodes to different computing nodes in sequence according to the octree structure, so that the load value of each computing node is balanced. As the simulation progresses, the load value of the leaf node is recalculated, and the leaf node is reallocated to the computing node according to the load value of the leaf node, so that the load value of the computing node is rebalanced. Based on the calculation load evaluation result, the present invention divides the process with unbalanced load into an octree grid, mainly adjusting between the processes of adjacent background grids, optimizing the load distribution of each computing node, and facilitating the data transmission of adjacent sub-areas during the calculation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this specification relate to the field of computer technology, and more particularly, to an octree-based computing node load balancing method and apparatus. Background Art

[0002] The material point method (MPM) discretizes material regions using point masses, each of which carries all material information, such as mass, position, and momentum. In hypervelocity collisions, the MPM can accurately simulate deformation, fragmentation, and sputtering of objects during these processes. Building on the MPM, the coupled material point finite difference method (FDM) has been developed for fluid-solid coupling processes with strong nonlinearities, and the coupled material point finite difference finite element method (FEM) has been developed for small deformation problems. During the initialization phase of the simulation, these methods achieve load balancing by rationally partitioning the subspace regions, allowing computational nodes to distribute computational tasks across multiple subspace regions. However, as the simulation progresses, the computational tasks assigned to each subspace region change, resulting in an uneven load on the computational tasks across different processes. Adjusting the computational load across different processes may require repartitioning the entire spatial region, resulting in significant computational and communication overhead.

[0003] Application Contents

[0004] This application describes an octree-based computing node load balancing method and device, which can solve the above technical problems.

[0005] According to a first aspect, a method for balancing computing node load based on an octree is provided, comprising: obtaining a computing area, dividing the computing area into a plurality of sub-areas, wherein the computing area is a space involved in computing during a simulation process of an explosion event;

[0006] Recursively dividing the calculation area until the load values of the smallest areas in the sub-areas are all less than a preset load value, thereby obtaining an octree structure corresponding to the calculation area, wherein the leaf nodes in the octree structure correspond to the smallest areas in the sub-areas;

[0007] Determining a space-filling curve for the computation region according to the octree structure, and sequentially allocating the leaf nodes to different computation nodes according to a filling order of the space-filling curve and load values of the leaf nodes, so that the load values of the computation nodes are balanced;

[0008] When the gap value of the computing node load value is greater than the preset gap value, the load value of the leaf node is recalculated, and the leaf node is reallocated to the computing node according to the load value of the leaf node, so that the load value of the computing node is rebalanced.

[0009] Based on the above embodiment, determining the space filling curve of the calculation area according to the octree structure specifically includes:

[0010] Traversing from the root node of the octree structure, assigning a corresponding code to each node, recursively accessing its child nodes until a leaf node is reached, and assigning a code to the leaf node;

[0011] The codes of the nodes in the path from the root node to the leaf node are expressed as a code sequence, and the code sequence is the Z-curve code of the leaf node;

[0012] Traversing the octree structure by a depth-first search method to obtain Z-curve codes of all leaf nodes in the octree structure;

[0013] The Z-curve codes of the leaf nodes are sorted using a lexicographical order to obtain a one-dimensional leaf node queue, where the leaf node queue is the space-filling curve of the calculation region.

[0014] Based on the above further embodiment, the leaf nodes are sequentially allocated to different computing nodes according to the filling order of the space-filling curve and the load values of the leaf nodes, so that the load values of the computing nodes are balanced, specifically including:

[0015] Determine the load value of each minimum area according to the computing task carried by the minimum area in the sub-area, where the load value of the minimum area is the load value of the corresponding leaf node;

[0016] Allocating leaf nodes corresponding to the current filling area to computing nodes in sequence according to the filling order of the space filling curve until the load of the computing node reaches a preset load threshold;

[0017] Continue to assign the leaf node corresponding to the next filling area to another computing node until all filling areas are assigned.

[0018] Based on the above embodiment, when the difference value of the calculated node load value is greater than the preset difference value, recalculating the load value of the leaf node specifically includes:

[0019] During the simulation process, according to a preset time interval, the difference between the maximum load value and the minimum load value in the calculation node is compared to see whether it is greater than a preset difference value;

[0020] If so, determining whether the load value of the leaf node in the octree structure is greater than a preset load value;

[0021] If so, the minimum areas corresponding to the leaf nodes with a load value greater than the preset value are divided until the load values of the minimum areas are all less than the preset load value, thereby obtaining a new octree structure, updating the space filling curve, and recalculating the load values of the leaf nodes in the new octree structure;

[0022] Otherwise, the load value of the leaf node in the octree structure is recalculated.

[0023] Based on the above embodiment, the method further includes:

[0024] quantifying the complexity of different computational tasks involved in the computational region, the computational tasks comprising one or more of a material point method computational task, a coupled material point finite difference method computational task, and a coupled material point finite difference finite element method computational task;

[0025] The load values of the sub-areas and the load values of the leaf nodes in the calculation area are determined according to the number of material points in the material point method calculation task, the number of fluid grids in the coupled material point finite difference method calculation task, and the number of rod units in the coupled material point finite difference finite element method calculation task.

[0026] Based on the above embodiment, the method further includes:

[0027] A temporary buffer is set between the computing nodes, and the temporary buffer is used to store the data to be transmitted by the computing nodes.

[0028] Based on the above embodiment, the method further includes: the computing nodes communicate with each other in a non-blocking manner.

[0029] According to a second aspect, an octree-based computing node load balancing device is provided, the device comprising:

[0030] The first processing module is used to obtain a calculation area and divide the calculation area into multiple sub-areas. The calculation area is a space involved in the calculation of the explosion simulation process;

[0031] A second processing module is configured to recursively divide the calculation area until the load values of the smallest areas in the sub-areas are all less than a preset load value, thereby obtaining an octree structure corresponding to the calculation area, wherein a leaf node in the octree structure corresponds to the smallest area in the sub-area;

[0032] a third processing module, configured to determine a space-filling curve for the computation region according to the octree structure, and sequentially distribute the leaf nodes to different computation nodes according to a filling order of the space-filling curve and the load values of the leaf nodes, so that the load values of the computation nodes are balanced;

[0033] The fourth processing module is used to recalculate the load value of the leaf node when the gap value of the load value of the computing node is greater than the preset gap value, and reallocate the leaf node to the computing node according to the load value of the leaf node, so that the load value of the computing node is rebalanced.

[0034] Based on the above embodiment, the third processing module is specifically configured to traverse from the root node of the octree structure, assign a corresponding code to each node, recursively access its child nodes until a leaf node is reached, and assign a code to the leaf node;

[0035] The codes of the nodes in the path from the root node to the leaf node are expressed as a code sequence, and the code sequence is the Z-curve code of the leaf node;

[0036] Traversing the octree structure by a depth-first search method to obtain Z-curve codes of all leaf nodes in the octree structure;

[0037] The Z-curve codes of the leaf nodes are sorted using a lexicographical order to obtain a one-dimensional leaf node queue, where the leaf node queue is the space-filling curve of the calculation region.

[0038] Based on the above embodiment, the third processing module is specifically configured to determine a load value of each minimum area according to the computing task carried by the minimum area in the sub-area, where the load value of the minimum area is the load value of the corresponding leaf node;

[0039] Allocating leaf nodes corresponding to the current filling area to computing nodes in sequence according to the filling order of the space filling curve until the load of the computing node reaches a preset load threshold;

[0040] Continue to assign the leaf node corresponding to the next filling area to another computing node until all filling areas are assigned.

[0041] Based on the above embodiment, the fourth processing module is specifically configured to compare, during the simulation process, according to a preset time interval, whether the difference between the maximum load value and the minimum load value in the computing node is greater than a preset difference value;

[0042] If so, determining whether the load value of the leaf node in the octree structure is greater than a preset load value;

[0043] If so, the minimum areas corresponding to the leaf nodes with a load value greater than the preset value are divided until the load values of the minimum areas are all less than the preset load value, thereby obtaining a new octree structure, updating the space filling curve, and recalculating the load values of the leaf nodes in the new octree structure;

[0044] Otherwise, the load value of the leaf node in the octree structure is recalculated.

[0045] Based on the above embodiment, the further comprising: a fifth processing module, configured to quantify the complexity of different computing tasks involved in the computing area, wherein the computing tasks include one or more of a material point method computing task, a coupled material point finite difference method computing task, and a coupled material point finite difference finite element method computing task;

[0046] The load values of the sub-areas and the load values of the leaf nodes in the calculation area are determined according to the number of material points in the material point method calculation task, the number of fluid grids in the coupled material point finite difference method calculation task, and the number of rod units in the coupled material point finite difference finite element method calculation task.

[0047] Based on the above embodiment, the third processing module is further configured to set a temporary buffer between the computing nodes, and the temporary buffer is configured to store the data to be transmitted of the computing nodes.

[0048] Based on the above embodiment, the third processing module is further configured to enable the computing nodes to communicate with each other in a non-blocking manner.

[0049] According to a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, the octree-based computing node load balancing method as described in the above technical solution is implemented.

[0050] According to a fourth aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, wherein when the processor executes the program, the octree-based computing node load balancing method as described in the above technical solution is implemented.

[0051] In the systems and methods described in the embodiments of this specification, based on computational load assessment results, processes with uneven loads are divided into octree grids. This primarily adjusts processes in adjacent background grids, optimizing the load distribution across each computing node and facilitating data transfer between adjacent sub-regions during the computation process. Utilizing buffer arrays and non-blocking communication, communication can be completed during the execution of computational tasks without requiring dedicated waiting time, effectively reducing communication traffic. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0053] Figure 1Schematic diagram of a computing node load balancing method based on an octree provided by the present invention;

[0054] Figure 2 It is a schematic diagram of the octree grid division provided by the present invention;

[0055] Figure 3 This is a flow chart of a computing node load balancing method based on an octree provided by the present invention;

[0056] Figure 4 This is a schematic diagram of an octree-based computing node load balancing device provided by the present invention. DETAILED DESCRIPTION

[0057] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0058] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.

[0059] In the description of the embodiments of the present application, words such as "exemplary," "for example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "for example," or "for example" in the embodiments of the present application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.

[0060] In the description of the embodiments of this application, the term "and / or" is merely a description of an association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent the following three situations: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "plurality" means two or more.

[0061] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly identifying the technical features being referred to. Thus, features specified as "first" or "second" may explicitly or implicitly include one or more of such features. The terms "include," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.

[0062] The material point method (MPM) discretizes material regions using particles, each of which carries all material information, such as mass, position, and momentum. The MPM has become an effective approach for solving highly nonlinear problems such as hypervelocity collisions, explosions, and impact penetration. In hypervelocity collisions, the MPM can accurately simulate phenomena such as deformation, fragmentation, and sputtering of objects during hypervelocity collisions. In explosion simulations, the MPM can capture complex physical phenomena such as the shock wave and fragment dispersion generated by the explosion. In impact penetration, the MPM can simulate the dynamic response of materials under impact loads, such as the process of a projectile penetrating a target. In dynamic fracture simulations, the MPM can capture processes such as crack initiation, propagation, and penetration. Building on the MPM, the coupled material point finite difference method (FDM) has been developed for fluid-solid coupling processes with strong nonlinearities, and the coupled material point finite difference finite element method (FEM) has been developed for small deformation problems. The above method can achieve load balancing of the computational tasks of each process by reasonably dividing the subspace regions in the initialization phase of the simulation. According to the computational tasks of each subspace region, each process loads the computational tasks of multiple subspace regions. However, as the simulation process progresses, the material points move frequently and at high speed in each subspace region, and the computational tasks of each subspace region change, resulting in an unbalanced load of the computational tasks of each process. Similarly, the fluid grid that affects the computational complexity of the finite difference method for coupled material points and the rod elements that affect the computational complexity of the finite difference finite element method for coupled material points may also move in each subspace region, causing the computational tasks of each subspace region to change, resulting in an unbalanced load of the computational tasks of each process. When it is necessary to adjust the load of the computational tasks of each process, it may be necessary to redivide the entire space region, resulting in large computational and communication overheads.

[0063] In view of this, this application proposes a load balancing method for computing tasks based on octree, which can solve the technical problem that the frequent high-speed movement of material points, the change of rod units and the movement of fluid grids in the simulation process will lead to the load imbalance of computing tasks executed between processes. Figure 1 As shown, the process of load balancing of computing tasks based on octree can include the following four stages / steps.

[0064] Step 1, computational load assessment, specifically includes: quantifying the complexity of different computational tasks for the material point method, coupled material point finite difference method, and coupled material point finite difference finite element method. For the material point method, the number of material points directly affects the computational complexity: the more material points a subspace region carries, the greater the computational load of that subspace region. For the coupled material point finite difference method, the more fluid grids in a subspace region, the greater the computational load of that subspace region. For the coupled material point finite difference finite element method (MPM-FDM-FEM), the more rod elements in a subspace region, the greater the computational load of that subspace region. Taking into account the number of material points, the number of fluid grids, and the number of rod elements in each subspace region, the total load of each subspace region is obtained. In this step, a computational load assessment method is constructed to accurately assess the computational load, laying a good foundation for load balancing and partitioning.

[0065] Step 2, octree meshing, specifically involves constructing an octree structure to divide the three-dimensional space involved in the event simulation into multiple subregions. These subregions are then recursively subdivided until the smallest unit of division—a leaf node—is reached. Each leaf node corresponds to a subspace region, and the load of each leaf node includes the number of material points, fluid grids, and rod elements in that subspace region. Traversing the octree structure from the root node, all of its child nodes are recursively visited. When a leaf node is reached, the load of that leaf node is recorded. Each node in the octree structure is assigned a unique code. The path from the root node to a leaf node can be represented as a code sequence, which is the Z-curve code of each leaf node. The Z-curve codes of all leaf nodes in the octree structure are collected through a distributed forward search (DFS) traversal. The leaf node Z-curve codes are sorted using lexicographic order to form a one-dimensional leaf node queue, known as a space-filling curve. The space-filling curve maintains the spatial proximity of adjacent subregions, facilitating data transmission between adjacent subregions during the material point method calculation process and achieving load balancing between adjacent regions.

[0066] Calculate the total load of each leaf node: Total load = material point workload + rod unit workload + grid workload. Based on the leaf node load, the leaf nodes are assigned to different computing nodes according to the order in the leaf node queue to ensure that the load of each computing node is roughly equal. In this way, a balanced load distribution can be achieved while maintaining the spatial proximity of the leaf nodes and reducing communication overhead. When the material points move frequently and at high speed, the rod units change, and the fluid grid moves, the load of the leaf nodes changes. The load of each leaf node is recalculated and, based on the load of each leaf node, the leaf nodes are reallocated to computing nodes according to the leaf node queue until the load of each computing node is close to the average load. In this step, the computational load of each process is evaluated based on the established computational load evaluation method. For processes with unbalanced loads, the octree grid is repartitioned, leveraging the characteristics of the octree grid management, and the grid is mainly repartitioned between processes of adjacent background grids.

[0067] Step 3, grid data transmission. To avoid frequent data dependencies between computing nodes, a temporary buffer array is created to package the data to be transmitted. For example, if process 0 and process 1 have 1,000 dependent data items, the mass and momentum of these 1,000 items are packaged and then transmitted to process 1. Furthermore, a non-blocking approach is used. While process 2 is transmitting data to process 3, process 0 is transmitting data to process 1 simultaneously, without affecting each other. Non-blocking communication can also be utilized, allowing communication to complete during the execution of computing tasks without requiring dedicated waiting time. For example, according to the calculation process of a material point, basic physical quantities of the material point, such as velocity and mass, are transmitted. Other physical quantities can be calculated based on these basic physical quantities, effectively reducing communication traffic.

[0068] Step 4, simulation, specifically includes: during the simulation process, using threshold setting, after a specific number of iterations, determining whether load adjustment is needed based on the difference in computational load between processes. If load adjustment is needed, the octree is further partitioned. If the minimum partition is achieved, the load between the computing nodes is directly adjusted based on the computational load. When it is determined that the octree has reached a critical point, the computational load is evenly distributed to other computing nodes to achieve load balancing.

[0069] Through the above method, when the computing tasks of each subspace area change, resulting in an unbalanced load of the computing tasks of each process and the load of the computing tasks of each process needs to be adjusted, an evaluation method is constructed based on the load characteristics of different computing methods to provide a basis for subsequent load balancing division. Based on the computing load evaluation results, the octree grid is re-divided for the process with unbalanced load, mainly between the processes of adjacent background grids, to optimize the load distribution of each computing node and facilitate the data transmission of adjacent sub-areas during the calculation process.

[0070] It should be noted that in high-performance computing (HPC) clusters or supercomputers, a compute node typically refers to an independent server or computer unit within the cluster. In parallel computing, a compute node can refer to a logical unit or thread. In network computing or distributed systems, a compute node can refer to a device or service within a network. In load balancing, a compute node is the basic unit of load distribution, responsible for processing local tasks or forwarding tasks to other nodes to achieve distributed computing and load balancing.

[0071] Below Figure 2This example illustrates how to use space-filling curves and octree partitioning to achieve load balancing among compute nodes. This example describes the entire process from space partitioning to inter-process load distribution. First, the computational space is divided into four first-level subregions: I, II, III, and IV. The load of each first-level subregion is calculated: the load of region I is 3, the load of region II is 4, the load of region III is 4, and the load of region IV is 8. Each region is accessed sequentially, ensuring that adjacent regions are also adjacent in the encoding. This yields a space-filling curve for the first partition. For first-level subregions with a load greater than 4, the first-level subregion I is partitioned into four second-level subregions. The loads of each subregion are calculated, yielding values of 1, 0, 2, and 1, respectively. First-level subregion IV is partitioned into four second-level subregions, each with a load of 4, 0, 0, and 0, respectively. The load of second-level subregion I in first-level subregion IV is 4. This is then partitioned a third time, into four third-level subregions, with the loads of 1, 1, 1, and 1, respectively. The resulting subspace is then divided three times. Encoding the leaf nodes yields 11, 12, 13, 14, 2, 311, 312, 313, 314, 32, 33, 34, 4. The corresponding loads for these leaf nodes are 1, 0, 2, 1, 3, 1, 1, 1, 1, 0, 0, 0, 2. Sorting the leaf nodes lexicographically yields the space-filling curve: 11->12->13->14->2->311->312->313->314->32->33->34->4. Distributing the load so that each process does not exceed 4, leaf nodes 11, 12, 13, and 14 are assigned to process 0, represented by red. Continuing the distribution, leaf node 2 is assigned to process 1, represented by green. Continuing the distribution, leaf nodes 311, 312, 313, 314, 32, 33, 34, and 4 are assigned to process 2, represented by blue. Processes 0, 1, and 2 are roughly load balanced. When the material point moves, the load in first-level subregion II decreases from 3 to 1, while the load in first-level subregion IV increases from 0 to 2. This requires redistributing the load across processes. According to the space-filling curve, leaf nodes 11, 12, 13, and 14 continue to be assigned to process 0. Leaf nodes 2, 311, and 312 are assigned to process 1, and leaf nodes 313, 314, 32, 33, 34, and 4 are assigned to process 2, thus restoring load balancing across processes.

[0072] The following combination Figure 3 The flowchart of the octree-based computing node load balancing method is described in detail, specifically:

[0073] 110. Obtain a calculation area and divide the calculation area into multiple sub-areas. The calculation area is the space involved in the calculation of the explosion simulation process.

[0074] 120. Recursively divide the calculation area until the load value of the smallest area in the sub-area is less than the preset load value, and obtain an octree structure corresponding to the calculation area, in which the leaf node corresponds to the smallest area in the sub-area.

[0075] Specifically, the complexity of different computational tasks involved in the computational area is quantified, where the computational tasks include one or more of a material point method computational task, a coupled material point finite difference method computational task, and a coupled material point finite difference finite element method computational task.

[0076] The load values of the sub-regions and leaf nodes in the calculation area are determined based on the number of material points in the material point method calculation task, the number of fluid grids in the coupled material point finite difference method calculation task, and the number of rod elements in the coupled material point finite difference finite element method calculation task.

[0077] It's important to note that not every material point needs to be weighted. For example, material points that are eroded or outside the boundary are not counted. Generally, if there are no material points in the background grid, the weight is set to 0, but this may result in a large number of grid transfers, affecting program efficiency. There are usually more grids than material points, so to ensure a more even distribution of material points per process and avoid excessive background grid transfers, a certain weight is also set for the grids, but the proportion of material points is set to a larger value.

[0078] 130. According to the octree structure, the space filling curve of the calculation area is determined, and the leaf nodes are sequentially distributed to different calculation nodes according to the filling order of the space filling curve and the load value of the leaf node, so that the load value of each calculation node is balanced.

[0079] Specifically, the method includes the following steps:

[0080] 131. Start traversing from the root node of the octree structure, assign a corresponding code to each node, recursively visit its child nodes until reaching a leaf node, and assign a code to the leaf node;

[0081] 132. The codes of the nodes in the path from the root node to the leaf node are expressed as a code sequence, and the code sequence is the Z-curve code of the leaf node;

[0082] 133. Traverse the octree structure through the depth-first search method to obtain the Z-curve coding of all leaf nodes in the octree structure;

[0083] 134. Use the lexicographical order to sort the Z-curve codes of the leaf nodes to obtain a one-dimensional leaf node queue. The leaf node queue is the space-filling curve of the calculation area.

[0084] 135. Determine the load value of each minimum region based on the computing task carried by the minimum region in the sub-region. The load value of the minimum region is the load value of the corresponding leaf node.

[0085] 136. Allocate leaf nodes corresponding to the current filling area to computing nodes in sequence according to the filling order of the space filling curve until the load of the computing node reaches a preset load threshold;

[0086] 137. Continue to allocate the leaf node corresponding to the next filling area to another computing node until all filling areas are allocated.

[0087] 140. When the gap value of the computing node load value is greater than the preset gap value, the load value of the leaf node is recalculated, and the leaf node is reallocated to the computing node according to the load value of the leaf node, so that the load value of the computing node is rebalanced.

[0088] Specifically, during the simulation process, according to a preset time interval, the difference between the maximum load value and the minimum load value in the calculation node is compared to see whether it is greater than a preset difference value;

[0089] If so, determine whether the load value of the leaf node in the octree structure is greater than the preset load value;

[0090] If so, the minimum area corresponding to the leaf node with a load value greater than the preset value is divided until the load value of the minimum area is less than the preset load value, a new octree structure is obtained, the space filling curve is updated, and the load value of the leaf node in the new octree structure is recalculated;

[0091] According to the updated filling order of the space filling curve and the load value of the leaf node, the leaf nodes are sequentially allocated to different computing nodes so that the load value of each computing node is balanced.

[0092] Otherwise, the load values of the leaf nodes in the octree structure are recalculated.

[0093] According to the filling order of the previous space filling curve and the load value of the updated leaf node, the leaf nodes are sequentially assigned to different computing nodes so that the load value of each computing node is balanced.

[0094] When the area corresponding to the computing node changes, a temporary buffer zone is set between the computing nodes. The temporary buffer zone is used to store data to be transmitted between the computing nodes.

[0095] Furthermore, computing nodes communicate with each other in a non-blocking manner.

[0096] In the above-described method provided in the embodiments of this specification, based on the computational load assessment results, processes with uneven loads are divided into octree grids. This primarily adjusts the load distribution between processes in adjacent background grids, optimizing the load distribution of each computing node and facilitating data transfer between adjacent sub-regions during the computation process. By utilizing a buffer array and non-blocking communication, communication can be completed during the execution of the computation task without requiring dedicated waiting time, effectively reducing communication traffic.

[0097] The following combination Figure 4 The schematic diagram of the computing node load balancing device based on the octree is shown in detail, specifically:

[0098] The first processing module is used to obtain a calculation area and divide the calculation area into multiple sub-areas. The calculation area is a space involved in the calculation of the explosion simulation process;

[0099] The second processing module is used to recursively divide the calculation area until the load value of the smallest area in the sub-area is less than the preset load value, thereby obtaining an octree structure corresponding to the calculation area, wherein the leaf node in the octree structure corresponds to the smallest area in the sub-area;

[0100] a third processing module, configured to determine a space-filling curve for the computation region according to the octree structure, and sequentially distribute the leaf nodes to different computation nodes according to a filling order of the space-filling curve and the load values of the leaf nodes, so that the load values of the computation nodes are balanced;

[0101] The fourth processing module is used to recalculate the load value of the leaf node when the gap value of the load value of the computing node is greater than the preset gap value, and reallocate the leaf node to the computing node according to the load value of the leaf node, so that the load value of the computing node is rebalanced.

[0102] Based on the above embodiment, the third processing module is specifically configured to traverse from the root node of the octree structure, assign a corresponding code to each node, recursively access its child nodes until a leaf node is reached, and assign a code to the leaf node;

[0103] The codes of the nodes in the path from the root node to the leaf node are expressed as a code sequence, and the code sequence is the Z-curve code of the leaf node;

[0104] Traversing the octree structure by a depth-first search method to obtain Z-curve codes of all leaf nodes in the octree structure;

[0105] The Z-curve codes of the leaf nodes are sorted using a lexicographical order to obtain a one-dimensional leaf node queue, where the leaf node queue is the space-filling curve of the calculation region.

[0106] Based on the above embodiment, the third processing module is specifically configured to determine a load value of each minimum area according to the computing task carried by the minimum area in the sub-area, where the load value of the minimum area is the load value of the corresponding leaf node;

[0107] Allocating leaf nodes corresponding to the current filling area to computing nodes in sequence according to the filling order of the space filling curve until the load of the computing node reaches a preset load threshold;

[0108] Continue to assign the leaf node corresponding to the next filling area to another computing node until all filling areas are assigned.

[0109] Based on the above embodiment, the fourth processing module is specifically configured to compare, during the simulation process, according to a preset time interval, whether the difference between the maximum load value and the minimum load value in the computing node is greater than a preset difference value;

[0110] If so, determining whether the load value of the leaf node in the octree structure is greater than a preset load value;

[0111] If so, the minimum areas corresponding to the leaf nodes with a load value greater than the preset value are divided until the load values of the minimum areas are all less than the preset load value, thereby obtaining a new octree structure, updating the space filling curve, and recalculating the load values of the leaf nodes in the new octree structure;

[0112] Otherwise, the load value of the leaf node in the octree structure is recalculated.

[0113] Based on the above embodiment, the further comprising: a fifth processing module, configured to quantify the complexity of different computing tasks involved in the computing area, wherein the computing tasks include one or more of a material point method computing task, a coupled material point finite difference method computing task, and a coupled material point finite difference finite element method computing task;

[0114] The load values of the sub-areas and the load values of the leaf nodes in the calculation area are determined according to the number of material points in the material point method calculation task, the number of fluid grids in the coupled material point finite difference method calculation task, and the number of rod units in the coupled material point finite difference finite element method calculation task.

[0115] Based on the above embodiment, the third processing module is further configured to set a temporary buffer between the computing nodes, and the temporary buffer is configured to store the data to be transmitted of the computing nodes.

[0116] Based on the above embodiment, the third processing module is further configured to enable the computing nodes to communicate with each other in a non-blocking manner.

[0117] In the above-described apparatus provided in the embodiments of this specification, based on the computational load assessment results, processes with uneven loads are divided into octree grids. This primarily adjusts processes in adjacent background grids, optimizing the load distribution of each computing node and facilitating data transfer between adjacent sub-regions during the computation process. Utilizing a buffer array and non-blocking communication, communication can be completed during the execution of computational tasks without requiring dedicated waiting time, effectively reducing communication traffic.

[0118] According to another embodiment, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, the octree-based computing node load balancing method in the above technical solution is implemented.

[0119] According to another embodiment, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute a method for load balancing computing nodes based on an octree.

[0120] Those skilled in the art will appreciate that, in one or more of the above examples, the functions described herein may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0121] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of this application. It should be understood that the above description is only the specific implementation methods of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of this application should be included in the scope of protection of this application.

Claims

1. A computing node load balancing method based on octree, characterized in that: The method comprises: Obtain a calculation area, and divide the calculation area into a plurality of sub-areas, wherein the calculation area is a space involved in calculation during the explosion event simulation process; Recursively dividing the calculation area until the load values of the smallest areas in the sub-areas are all less than a preset load value, thereby obtaining an octree structure corresponding to the calculation area, wherein the leaf nodes in the octree structure correspond to the smallest areas in the sub-areas; Determining a space-filling curve for the computational region according to the octree structure, and sequentially allocating leaf nodes to different computational nodes according to a filling order of the space-filling curve and the load values of the leaf nodes, so that the load values of the computational nodes are balanced; and when a gap value between the load values of the computational nodes is greater than a preset gap value, recalculating the load values of the leaf nodes, and reallocating the leaf nodes to the computational nodes according to the load values of the leaf nodes, so that the load values of the computational nodes are rebalanced; When the difference value of the calculated node load value is greater than the preset difference value, recalculating the load value of the leaf node includes: During the simulation process, according to a preset time interval, the difference between the maximum load value and the minimum load value in the calculation node is compared to see whether it is greater than a preset difference value; If so, determine whether the load value of the leaf node in the octree structure is greater than the preset load value; If so, the minimum area corresponding to the leaf node with a load value greater than the preset value is divided until the load value of the minimum area is less than the preset load value, a new octree structure is obtained, the space filling curve is updated, and the load value of the leaf node in the new octree structure is recalculated; According to the updated filling order of the space filling curve and the load value of the leaf node, the leaf nodes are sequentially assigned to different computing nodes so that the load value of each computing node is balanced; Otherwise, the load values of the leaf nodes in the octree structure are recalculated.

2. The method according to claim 1, characterized in that Determining the space filling curve of the calculation area according to the octree structure specifically includes: Traversing from the root node of the octree structure, assigning a corresponding code to each node, recursively accessing its child nodes until a leaf node is reached, and assigning a code to the leaf node; The codes of the nodes in the path from the root node to the leaf node are expressed as a code sequence, and the code sequence is the Z-curve code of the leaf node; Traversing the octree structure by a depth-first search method to obtain Z-curve codes of all leaf nodes in the octree structure; The Z-curve codes of the leaf nodes are sorted using a lexicographical order to obtain a one-dimensional leaf node queue, where the leaf node queue is the space-filling curve of the calculation region.

3. The method according to claim 1, characterized in that Allocating the leaf nodes to different computing nodes in sequence according to the filling order of the space filling curve and the load values of the leaf nodes so that the load values of the computing nodes are balanced specifically includes: Determine the load value of each minimum area according to the computing task carried by the minimum area in the sub-area, where the load value of the minimum area is the load value of the corresponding leaf node; Allocating leaf nodes corresponding to the current filling area to computing nodes in sequence according to the filling order of the space filling curve until the load of the computing node reaches a preset load threshold; Continue to assign the leaf node corresponding to the next filling area to another computing node until all filling areas are assigned.

4. The method according to claim 1, wherein When the difference value of the calculated node load value is greater than the preset difference value, recalculating the load value of the leaf node specifically includes: During the simulation process, according to a preset time interval, the difference between the maximum load value and the minimum load value in the calculation node is compared to see whether it is greater than a preset difference value; If so, determining whether the load value of the leaf node in the octree structure is greater than a preset load value; If so, the minimum areas corresponding to the leaf nodes with a load value greater than the preset value are divided until the load values of the minimum areas are all less than the preset load value, thereby obtaining a new octree structure, updating the space filling curve, and recalculating the load values of the leaf nodes in the new octree structure; Otherwise, the load value of the leaf node in the octree structure is recalculated.

5. The method according to claim 1, wherein The method further comprises: quantifying the complexity of different computational tasks involved in the computational region, the computational tasks comprising one or more of a material point method computational task, a coupled material point finite difference method computational task, and a coupled material point finite difference finite element method computational task; The load values of the sub-areas and the load values of the leaf nodes in the calculation area are determined according to the number of material points in the material point method calculation task, the number of fluid grids in the coupled material point finite difference method calculation task, and the number of rod units in the coupled material point finite difference finite element method calculation task.

6. The method according to claim 1, characterized in that The method further comprises: A temporary buffer is set between the computing nodes, and the temporary buffer is used to store the data to be transmitted by the computing nodes.

7. The method according to claim 1, characterized in that The method further comprises: The computing nodes communicate with each other in a non-blocking manner.

8. A computing node load balancing device based on octree, characterized in that: The device comprises: The first processing module is used to obtain a calculation area and divide the calculation area into multiple sub-areas. The calculation area is a space involved in the calculation of the explosion simulation process; A second processing module is configured to recursively divide the calculation area until the load values of the smallest areas in the sub-areas are all less than a preset load value, thereby obtaining an octree structure corresponding to the calculation area, wherein a leaf node in the octree structure corresponds to the smallest area in the sub-area; a third processing module, configured to determine a space-filling curve for the computation region according to the octree structure, and sequentially distribute the leaf nodes to different computation nodes according to a filling order of the space-filling curve and the load values of the leaf nodes, so that the load values of the computation nodes are balanced; a fourth processing module, configured to recalculate the load values of the leaf nodes when the gap value of the load values of the computing nodes is greater than a preset gap value, and reallocate the leaf nodes to the computing nodes according to the load values of the leaf nodes, so that the load values of the computing nodes are rebalanced; The fourth processing module is used to compare whether the difference between the maximum load value and the minimum load value in the calculation node is greater than the preset difference value according to the preset time interval during the simulation process; If so, determine whether the load value of the leaf node in the octree structure is greater than the preset load value; If so, the minimum area corresponding to the leaf node with a load value greater than the preset value is divided until the load value of the minimum area is less than the preset load value, a new octree structure is obtained, the space filling curve is updated, and the load value of the leaf node in the new octree structure is recalculated; According to the updated filling order of the space filling curve and the load value of the leaf node, the leaf nodes are sequentially assigned to different computing nodes so that the load value of each computing node is balanced; Otherwise, the load values of the leaf nodes in the octree structure are recalculated.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the octree-based computing node load balancing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Octree grid layer-by-layer load balancing method

    CN113918348A

  • Domain decomposition using a multi-dimensional spacepartitioning tree

    US20150331964A1