Parallel optimization method and system for high performance computers

By constructing a local task inheritance tree and using remote direct memory access, the problem of dynamic load skew in adaptive mesh refinement is solved, achieving efficient and low-overhead load balancing and computational optimization, and improving the overall computing efficiency of high-performance computers.

CN122346356APending Publication Date: 2026-07-07JIANGXI UNIVERSITY OF FINANCE AND ECONOMICS
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGXI UNIVERSITY OF FINANCE AND ECONOMICS
Filing Date
2026-04-08
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

The dynamic skew of computational load caused by adaptive mesh refinement cannot be detected in advance and balanced in a timely manner by existing methods. Furthermore, dynamic scheduling methods suffer from problems such as high global communication overhead, dependence on central nodes, and failure to utilize the inheritance costs of parent and child meshes.

Method used

Construct a local task inheritance tree and label the inheritance cost. Each process only exchanges the root node inheritance cost with neighboring processes. Use the exponential decay averaging method to update the global load baseline, trigger pre-splitting, and implement asynchronous delegation of task metadata and result write-back through remote direct memory access. Combine dynamic programming and greedy algorithm to optimize task partitioning.

Benefits of technology

It achieves proactive load awareness, avoids the need for early prevention of load imbalance, reduces global communication overhead, optimizes task partitioning, improves computing efficiency and resource utilization, and has fault tolerance capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122346356A_ABST
    Figure CN122346356A_ABST
Patent Text Reader

Abstract

The application discloses a parallel optimization method and system for a high-performance computer and relates to the technical field of computer performance optimization. The method constructs a local task inheritance tree for each parallel process and labels inheritance cost. Each process only exchanges root node inheritance cost with adjacent processes and updates a global load baseline, and triggers pre-splitting when the local cost exceeds the baseline dynamic threshold. Subnode division schemes are enumerated, load balancing benefits and communication costs are quantified through a split benefit formula, the optimal scheme is selected to divide the calculation unit, task meta information is written into the target process through a remote direct memory access one-way write operation, the target process writes back the result after completion, the current process polls the completion flag and recycles, and the timeout task can be re-delegated. The application realizes the pre-perception and dynamic balancing of load and improves parallel computing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer performance optimization technology, and more specifically, to a parallel optimization method and system for high-performance computers. Background Technology

[0002] In the field of high-performance computing, parallel processing is an important means to improve computing efficiency. By decomposing large-scale computing tasks into multiple subtasks and executing them simultaneously on multiple processors, computing time can be significantly shortened. However, in large-scale scientific computing using adaptive mesh refinement, the computing load of each parallel process fluctuates dramatically during runtime due to the dynamic nature of mesh refinement. This results in some processes having a significantly higher computing load than others, leading to a load imbalance.

[0003] Existing parallel optimization methods often employ static task partitioning or pre-set parallelism strategies based on historical data, making it difficult to adapt to dynamic changes in runtime load. For example, Chinese patent CN117194041A discloses a parallel optimization method and system for high-performance computers. This method classifies storage modules according to their computational characteristics and assigns computational processes to the corresponding storage modules after matching them with the storage module categories. However, since the classification and matching are completed before the task starts, it cannot dynamically adjust task allocation based on changes in runtime load. Similarly, Chinese patent CN109885384A discloses a task parallelism optimization method. This method calculates parallelism based on historical runtime statistics of daily batch scheduling tasks or source data table information of newly created batch scheduling tasks. However, its parallelism is determined before the task starts and cannot be adjusted during runtime.

[0004] Furthermore, some patents involving dynamic task scheduling have failed to offer effective solutions for adaptive mesh refinement scenarios. For example, Chinese patent CN121190664A discloses a method for constructing a Gaussian data tree index that supports incremental updates, which involves node splitting and threshold judgment. However, its splitting purpose is to maintain data balance in the index structure, rather than addressing the problem of computational load skew, and its splitting decision does not rely on the quantification of future computational costs. Chinese patent CN121542012A discloses an adaptive task scheduling method based on real-time node feedback, which achieves load balancing through centralized scheduling of the master node. This method suffers from single-point bottlenecks and global communication overhead, making it unsuitable for scenarios in large-scale adaptive mesh refinement simulations where processes only need to exchange local information. Chinese patent CN120602486A discloses a distributed data processing method based on cloud computing, which uses dynamic resharding based on load thresholds, but it does not consider the inheritance cost relationship between parent and child meshes and does not employ a forward-looking pre-splitting mechanism.

[0005] Therefore, there is an urgent need for a parallel optimization method that can anticipate load changes, make decisions based solely on local information, and asynchronously and with low overhead implement task reallocation in order to solve the dynamic load balancing problem in adaptive mesh refinement computation. Summary of the Invention

[0006] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a parallel optimization method and system for high-performance computers. The technical problem to be solved is: (1) Adaptive mesh refinement leads to dynamic tilting of computational load, which existing methods cannot detect in advance and balance in time.

[0007] (2) Existing dynamic scheduling methods have problems such as large global communication overhead, dependence on central nodes, and failure to utilize the inheritance cost of parent and child grids.

[0008] To achieve the above objectives, the present invention provides the following technical solution: a parallel optimization method for high-performance computers, applied to adaptive mesh refinement calculation scenarios, comprising the following steps: S1: Construct the local task inheritance tree and label the inheritance cost. When the grid block currently being processed by a process is refined into sub-grid blocks according to adaptive grid refinement rules, a local task inheritance tree is constructed for each parallel process. The root node of the task inheritance tree is the grid block currently being processed, and the child nodes are the sub-grid blocks generated after refinement. An inheritance cost is labeled for each node, which is the sum of the local computation costs of all nodes in the subtree rooted at that node.

[0009] S2: Swap the root node inheritance cost and trigger a pre-split. Each process only exchanges root node inheritance costs with neighboring processes whose physical distance is less than a preset threshold, and updates the global load baseline in local storage using an exponentially decaying average method. When the difference between the root node inheritance cost and the global load baseline exceeds a dynamic threshold, a pre-splitting of the set of child nodes under the root node of that process is triggered. The dynamic threshold is linked to the global load baseline.

[0010] Furthermore, the dynamic threshold is determined based on a fixed proportion of the current global load baseline, which is between 20% and 50%.

[0011] S3: Enumerate candidate splitting schemes Based on the task inheritance tree of the process that triggered the pre-split, all partitioning schemes of the set of direct child nodes of its root node are enumerated as candidate partitioning schemes. Each partitioning scheme divides the set of child nodes into one or more computational units.

[0012] Furthermore, the enumeration partitioning scheme works as follows: when the number of child nodes is less than or equal to a preset threshold... When using dynamic programming to traverse all partitioning schemes, the state transition equation is as follows: ,in For the first The inheritance cost of each child node; when the number of child nodes exceeds a preset threshold. When using a greedy algorithm, the child nodes are first sorted in descending order of inheritance cost and then assigned to the group with the lowest total cost. Then, multiple variant schemes are generated by adjusting the boundary through a sliding window.

[0013] S4: Calculate splitting benefits and select the target process For each candidate splitting scheme, a target process is selected for each computing unit. The target process satisfies the following conditions: its physical distance from the current process is less than a preset distance threshold, and its current load is less than a preset load threshold. The current load is obtained through computation progress signatures exchanged between processes. Then, the splitting benefit is calculated. : ; in, The cost of inheritance for the root node; , For the first The sum of the inheritance costs of child nodes in each computing unit To calculate the number of units; , For the first The sum of the data volume of child nodes in each computing unit For the first The physical distance of the target process corresponding to each computing unit is measured in network hops; These are preset coefficients.

[0014] Furthermore, the specific method for selecting a target process for each computing unit is as follows: obtain network topology information to determine the physical distance, and obtain the current load of each target process. Calculate the cost of the contract. ,in To be compatible with the target process physical distance, To calculate the amount of data in a unit, Preset coefficients; select to make Minimum target process: , This is the set of candidate target processes.

[0015] S5: Select the optimal splitting scheme and divide. choose The largest candidate split is the optimal solution, and the set of child nodes of the root node is divided into multiple computational units according to this solution. Among them, computational units where the target process is not the current process itself are removed from the local task inheritance tree, while computational units where the target process is the current process itself are retained.

[0016] S6: Write task metadata via remote direct memory access For each computing unit to be delegated to another process, the current process writes its task metadata into the memory area pre-registered by the target process through a one-sided write operation of remote direct memory access. At the same time, it generates a globally unique delegate identifier and records the delegate identifier and timeout timestamp in the delegated transaction tracking table.

[0017] S7: The target process calculates and writes back the results. After the target process completes the computation, it writes the result back to the pre-allocated result storage area of ​​the current process through a one-sided write operation of remote direct memory access, and sets the corresponding completion flag through an atomic operation.

[0018] S8: Polling completion flag and collect results After each local computation step is completed, the current process polls the completion flag corresponding to each delegate identifier in the delegated transaction tracking table. When a completion flag is detected, the computation result is read from the current process's result storage area, and the delegate record is deleted. If no completion flag is detected after exceeding the timeout threshold estimated based on historical computation time, the task is marked as re-delegable and reallocated in the next round of pre-splitting.

[0019] Furthermore, the specific method for polling the completion flag is as follows: the current process checks the completion flag through atomic operations during each local computation time step interval; when the completion flag is set, the computation result is read from the result storage area of ​​the current process, and the delegate record in the tracking table is deleted; if the completion flag is not detected after a timeout, the task status is reset to pending delegation and added to the pending re-delegation queue.

[0020] A parallel optimization system for high-performance computing, applied to adaptive mesh refinement computation scenarios, includes: Task tree construction module: used to build a local task inheritance tree for each process during mesh refinement, and to label the inheritance cost for each node; the inheritance cost is the sum of the local computation costs of all nodes in the subtree rooted at that node.

[0021] Pre-split trigger module: Used to enable each process to exchange root node inheritance costs with neighboring processes, update the global load baseline using an exponential decay averaging method, and trigger a pre-split when the root node inheritance cost exceeds the sum of the global load baseline and a dynamic threshold.

[0022] Split Decision Module: Used to enumerate partitioning schemes of the root node's child node set as candidate splitting schemes, using the formula... Calculate the splitting benefit, where For the root node inheritance cost, This represents the maximum sum of the inheritance costs of child nodes in each computational unit after the split. This is a weighted sum of data volume and physical distance. The preset coefficients are used; the scheme with the greatest benefit is selected for division.

[0023] Furthermore, when the number of child nodes is less than or equal to a preset threshold, the splitting decision module uses dynamic programming to traverse all partitioning schemes, and the state transition equation is as follows: ,in For the first The inheritance cost of each child node is calculated; when the number of child nodes exceeds a preset threshold, a greedy algorithm is used to allocate them in descending order of inheritance cost, supplemented by a sliding window adjustment.

[0024] Delegated execution module: It is used to select the target process for each computing unit according to the optimal solution, write the task meta information to the target process through one-sided write operation of remote direct memory access, generate a unique identifier for each delegated task and record it; after the target process completes, it writes back the result through remote direct memory access; after the current process completes each local computing step, it polls the completion flag, and if it is not completed within the timeout period, it is marked as re-delegated.

[0025] Furthermore, when selecting a target process, the delegated execution module obtains network topology information to determine the physical distance, obtains the current load of each target process, and calculates the delegation cost. ,in Physical distance To calculate the amount of data in a unit, For the current load, The preset coefficients are used, and the target process with the lowest commission cost is selected.

[0026] The technical effects and advantages of this invention are as follows: (1) Proactive Load Awareness: By constructing a local task inheritance tree for each process, the refinement relationship between parent and child grids is quantified into a computable tree structure. The inheritance cost of each node is calculated recursively from bottom to top and is defined as the sum of the local computation costs of the node and all its descendant nodes, enabling each process to accurately predict the total computational load that will be generated by grid refinement in the future. This mechanism advances the task reallocation time from after the load imbalance occurs to before the load change occurs, proactively preventing the emergence of laggards and avoiding overall computational delays caused by sudden load increases.

[0027] (2) Low-overhead distributed triggering: Each process only exchanges root node inheritance costs with neighboring processes whose physical distance is less than a preset hop count threshold, completely avoiding global communication and centralized coordination. The exponential decay averaging method is used to fuse historical estimates with current neighboring observations to update the global load baseline, effectively smoothing load fluctuations and preventing frequent false triggers. The dynamic threshold is linked to the current global load baseline, taking a fixed proportion of the baseline so that the triggering conditions are adaptively adjusted with the overall load level, avoiding the problem of unsuitability of fixed thresholds when the overall load increases or decreases, and realizing lightweight, adaptive load skew early warning.

[0028] (3) Quantifying the optimal task partitioning: A partitioning benefit evaluation method is proposed, comprehensively considering the load balancing benefits and communication cost penalties. The load balancing benefits are measured by comparing the total inheritance cost of the root node before partitioning with the maximum inheritance cost in each computing unit after partitioning. The communication cost penalty is quantified by calculating the weighted sum of the data volume of each computing unit and the physical distance to the target process, where the physical distance is measured in network hops. For small-scale child node sets, dynamic programming is used to traverse all partitioning schemes to ensure global optimality; for large-scale child node sets, a greedy algorithm is used to quickly obtain an approximate optimal scheme. By selecting the scheme with the greatest benefit, an explicit quantitative trade-off between load balancing and communication overhead is achieved, avoiding performance degradation caused by blind migration.

[0029] (4) Asynchronous Zero-Copy Delegation: This method utilizes a one-sided write operation via remote direct memory access to directly write task metadata into the pre-registered memory area of ​​the target process. This process does not consume the target process's CPU, requires no interrupt handling, and avoids the kernel protocol stack overhead of traditional message passing. The delegator continues local computation immediately after writing the task metadata without waiting for any response from the target process. After the target process completes the computation, it also writes the computation result directly back to the pre-allocated result storage area of ​​the delegator via a one-sided write operation via remote direct memory access, and sets the completion flag through an atomic operation. The entire delegation and write-back process has no synchronous waiting points. The delegator and target work completely asynchronously in parallel, achieving complete overlap between computation and communication, effectively hiding task migration delays.

[0030] (5) Fault Tolerance and Robustness: After completing each local computation step, the delegator polls the completion flag and uses atomic read operations to check the status, without blocking the computation thread or creating additional polling threads. The timeout is estimated based on the weighted average of historical computation times. If the task is not completed within the estimated time, its status is reset to pending delegation and added to the re-delegation queue, participating in the allocation in the next round of pre-splitting to avoid task loss due to a single failure. Tasks that fail to be re-delegated multiple times are automatically switched to local execution to prevent infinite waiting. This mechanism ensures that the system can still operate stably under node computation jitter, network latency fluctuations, or target process failures, and has good fault tolerance. Attached Figure Description

[0031] Figure 1 This is a flowchart illustrating the method execution of the present invention; Figure 2 This is a system module framework diagram of the present invention; Figure 3 This is a flowchart of the pre-splitting trigger judgment process of the present invention; Figure 4 This is a flowchart illustrating the enumeration and selection process for the splitting schemes in this invention. Detailed Implementation

[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] Example 1 As attached Figures 1 to 4 The parallel optimization method and system for high-performance computers shown are implemented as follows.

[0034] The invention will now be described in detail with an example of adaptive mesh refinement. Those skilled in the art should understand that this example is merely for illustrating the implementation process of the invention and does not constitute a limitation on the scope of protection of the invention. For example, in shock tube simulation, the initial computational domain is divided into a Cartesian mesh, a high-performance computer cluster contains multiple computing nodes, each node is configured with multiple CPU cores, inter-process communication is performed using MPI, and network interconnection uses InfiniBand, supporting remote direct memory access one-sided operations.

[0035] I. Initialization Phase Before the calculation begins, perform the following initialization operations: Each process calls `ibv_reg_mr` to register its pre-allocated buffer memory region. This buffer includes a task metadata buffer, a result storage area, and a completion flag area. After registration, it obtains the remote access key `rk`. The buffer address and `rk` are broadcast to all processes via `MPI_Allgather`, allowing each process to obtain the RDMA write target address and key from the other processes.

[0036] By reading the hardware topology configuration file or calling the system interface, the connection relationships between nodes are obtained, and a list of neighboring processes is established. Proximity processes are defined as adjacent nodes located on the same compute node or the same switch. Physical distance. Defined as network hop count: the number of processes within the same node. Different nodes under the same switch Cross-switch node .

[0037] List of neighboring processes The construction method is as follows: each process obtains its own node identifier, collects the node identifiers of all processes through MPI_Allgather, filters out processes with the same node identifier or located on the same switch, sorts them according to the network hop count, and retains processes with a hop count of less than or equal to 2 as neighboring processes.

[0038] II. Specific Implementation Steps of the Method Step S1: Construct the task inheritance tree and label the inheritance cost. Each parallel process builds a task inheritance tree locally based on its initial grid block. Root node The grid block responsible for the current process. The node structure contains: a parent pointer, an array of child pointers (children), and the local computation cost. (Floating-point numbers), inheritance cost (Floating-point number), grid block level (integer), data size (integer).

[0039] When a grid block is refined according to adaptive grid refinement rules, the resulting sub-grid blocks become children of the root node. The parent of each child node points to the root node, and pointers to child nodes are added to the root node's children array, forming a multi-level tree. The tree structure is recursively constructed and updated using depth-first traversal.

[0040] For each node Mark inheritance cost , defined as the sum of the local computation costs of all nodes in the subtree rooted at that node: ; in, For nodes The local computation cost (the computation time of the node's own grid block). For nodes The set of all direct child nodes.

[0041] Local computing cost Based on historical operational data fitting, the actual computation time of this node over the past 10 time steps was recorded. Updated using the exponentially weighted moving average method: ; in The attenuation coefficient is set to 0.8. For the local computing cost of the previous time step, For the updated local computing cost, This represents the actual computation time taken at the current time step.

[0042] For newly generated nodes, their initial local computation cost is estimated based on the parent node cost and the refinement factor: , This is to refine the number of child nodes.

[0043] When calculating inheritance costs, recursively calculate from the leaf nodes upwards: leaf nodes (without children) For non-leaf nodes, traverse all their child nodes and sum the child nodes' values. Then add This recursion executes once at the beginning of each time step, using a depth-first postorder traversal, with a time complexity of [missing information]. , where |V| is the total number of tree nodes.

[0044] Step S2: Swap the root node inheritance cost and determine if a pre-split is triggered. After each time step is completed, all processes execute step S2. Each process only exchanges root node inheritance costs with physically neighboring processes. Global communication is not performed.

[0045] Let the current process ID be pid, and its neighboring process set be... , The process ID (PID) is received asynchronously from neighboring processes via MPI_Irecv. The value is sent asynchronously via MPI_Isend. Value. After communication is complete, the PID obtains the root node inheritance cost set of the neighboring processes. .

[0046] The PID is updated using an exponentially decaying average method to update the global load baseline of local storage. Initial value Obtained through the first global communication (calculated by averaging after all processes complete the first time step using MPI_Allreduce). The update formula is: ; in The attenuation coefficient is set to 0.7, and |N| represents the number of neighboring processes. This is the sum of the inheritance costs of the root nodes of neighboring processes. (Updated) Store as new For use in the next time step.

[0047] Dynamic threshold Based on the current global load baseline The fixed proportion is determined to be 30%, that is... This ratio can be configured within the range of 20% to 50%.

[0048] If the root node inheritance cost of the current process satisfy If the condition is met, a pre-splitting is triggered, and the process proceeds to step S3; otherwise, normal calculation continues, and the process proceeds to the next time step.

[0049] Step S3: Enumerate candidate splitting schemes Based on the task inheritance tree of the process that triggered the pre-split. Enumerate the root node child node set All partitioning schemes are considered as candidate splitting schemes. The child node set contains all direct children of the root node, let the number of child nodes be . .

[0050] when When the value is no greater than 8, a dynamic programming algorithm is used to traverse all partitioning schemes. Let the cost sequence inherited by child nodes be... ,in For the first Inheritance cost of child nodes Define dp[i][g] as the value of the previous... The child nodes are divided into Minimum and maximum inheritance costs during grouping. Initialization. ,for and The state transition equation is: ; in Indicates the preceding The child nodes have been divided into Group, remaining child nodes arrive As the first Group. When hour, Traverse all and Then, all partitioning schemes are obtained through backtracking.

[0051] when When the value is greater than 8, a greedy algorithm is used to generate candidate partitioning schemes: First, sort the child nodes in descending order of inheritance cost, and then assign each child node to the group with the smallest total inheritance cost in turn, until all child nodes are assigned, generating a partitioning scheme; then, change the grouping boundary by sliding window, and move the boundary between adjacent groups 1 to 2 nodes to the left or right to form a new partitioning scheme.

[0052] Step S4: Calculate the splitting benefit and select the target process This step determines the optimal splitting scheme among the candidate splitting schemes and selects a target process for each computational unit.

[0053] (1) Select the target process for each computing unit For each candidate splitting scheme This scheme will set the child nodes. Divided into Each computing unit Each computing unit It is a group of child nodes.

[0054] Each process maintains a computation progress signature, containing three fields: the amount of data processed. Grid block hierarchy Estimated remaining computational workload Signatures are exchanged between neighboring processes via MPI non-blocking communication. (Load) Normalize to the [0,1] interval: ,when hour .

[0055] For each computational unit Select target process Candidate target process set Includes all physical distances less than a preset distance threshold (Take 2) and current load Less than the preset load threshold (Take 0.8) neighboring processes, and the current process itself. For each candidate target process Calculate the commission cost : ; in, For the current process and the target process physical distance, For computing unit Data volume ( ), For the target process The current load, The preset coefficient is 0.5. Select to enable... The smallest candidate target process is designated as the delegated target: ; (2) Calculate the splitting benefits After selecting the target process for all computing units, the splitting scheme is calculated. The benefits of division : ; The terms in the formula are defined as follows: The cost of inheritance for the root node.

[0056] ,in For the first The sum of the inheritance costs of all child nodes in each computing unit.

[0057] ,in For the first The sum of the data volume of the child nodes of each computing unit For the first The physical distance of the target process corresponding to each computing unit.

[0058] The preset coefficient is 0.2.

[0059] Step S5: Select the optimal splitting scheme Iterate through all candidate splitting schemes and calculate their respective splitting benefits. , choose to The largest candidate splitting scheme is selected as the optimal splitting scheme. .

[0060] root node child node set According to the optimal splitting scheme It is divided into multiple computation units. For each computation unit, if its target process is not the current process itself, then the computation unit is removed from the local task inheritance tree (from...). (Delete these child nodes), and record the computation unit. and target process For later use. For computational units whose target process is the current process itself, they are retained in the local task inheritance tree.

[0061] Step S6: Write task metadata via RDMA For each computational unit to be delegated recorded in step S5, perform the following operations: Assign a unique delegate identifier to each computing unit The delegate identifier is a 64-bit integer, generated by incrementing a process-local counter and combining it with the process ID. .

[0062] The task metadata of the computing unit is written to a specified memory region of the target process via RDMA. The task metadata includes grid coordinates (…). Four double-precision floating-point numbers), initial conditions (density) ,pressure ,speed Initial value arrays of physical quantities, calculation parameters (time step) Boundary condition types wait).

[0063] Task metadata is packaged into a fixed-length structure (512 bytes) and written to a buffer pre-allocated by the target process via RDMA. .

[0064] RDMA operations use the target process address obtained during the initialization phase. and remote access key The client constructs an ibv_send_wr structure, sets the operation type to IBV_WR_RDMA_WRITE, and the target address to... The remote key is The data source is the local task metadata buffer, and ibv_post_send is called to initiate a one-sided write operation. After the operation is completed, the write is confirmed by polling the completion queue.

[0065] Entrustment Identifier Timeout timestamp Delegated transaction tracking table recorded in the current process Chinese. Entrusted Transaction Tracking Form Implemented using a lock-free hash table, with the key being the delegation identifier. The value includes the timeout timestamp. The structure. Completion mark. Stored at a fixed offset in the result area of ​​the target process, using a 64-bit atomic variable with an initial value of 0.

[0066] Step S7: The target process performs the calculation and returns the result. The target process polls its task buffer and begins execution upon detecting a new task. Polling employs a lock-free read operation, periodically checking the valid flag bits of the task metadata structure in the buffer. When a valid flag is detected, the task metadata is read, the mesh coordinates, initial conditions, and calculation parameters are parsed, mesh data is generated locally, and calculations are performed. The calculation process includes mesh discretization, numerical solution, and physics field update.

[0067] After the calculation is complete, the target process writes the calculation results back to the current process's result storage area via RDMA. The calculation results include the updated values ​​of each physical field (density field). Pressure field Velocity field The results are packaged into contiguous memory blocks. RDMA one-sided write operations are used to directly write the results to the pre-allocated result area of ​​the current process. After the write operation is complete, the target process will set the completion flag using an RDMA atomic write operation. Set from 0 to 1.

[0068] Step S8: Poll the completion flag and collect the results. After completing each local computation step, the current process checks the delegated transaction trace table. The completion mark corresponding to each commissioned item. Use atomic read operations to check the status of the flag bits.

[0069] When detected At that time, from the result storage area pre-allocated by the current process Read the calculation result from the database and extract the delegated record from the delegated transaction tracking table. Delete it.

[0070] If no completion flag is detected within the timeout period, the task will be marked as eligible for re-delegation. Timeout period Set to 1.5 times the estimated execution time. The estimated execution time is fitted based on historical data. , .

[0071] like No detection was detected after a certain time. , entrust identifier from Removed from and added to the queue of pending re-delegations. In the pre-split decision at the next time step, The tasks in the process are included as units to be assigned in the candidate splitting scheme enumeration.

[0072] III. Time Step Loop After completing all calculations and collecting results in the current time step, all processes proceed to the next time step, repeating steps S1 to S8 until the simulation ends. Re-delegation queue. When a task in the current process starts at the next time step, it participates in the split decision along with the root node of the current process, meaning it is included as an independent computational unit in the candidate split scheme. If a task fails to be re-delegated three times consecutively, it is marked as an exception and executed locally.

[0073] IV. Detailed Implementation of the System Task tree building module: This module runs in each parallel process and maintains a local task inheritance tree. It uses a dynamic tree structure for storage, and each node structure contains: a parent pointer, an array of children pointers, and local computation cost. (float), inheritance cost (float), level (int), data size (int).

[0074] When the grid is refined, `create_child()` is called to create child nodes, the child node's `parent` is set to point to the current node, and the child node pointer is added to the current node's `children` array. Then, `update_cost()` is recursively called to update the inheritance cost of all ancestor nodes from bottom to top. The implementation of `update_cost()` is as follows: if the current node has no child nodes, then... ;otherwise Then, the parent node's update_cost() is called recursively.

[0075] Pre-splitting trigger module: This module is responsible for exchanging root node inheritance costs with physically neighboring processes. At the end of each time step, non-blocking communication is initiated via MPI_Isend and MPI_Irecv. The communication data structure contains... The value is MPI_DOUBLE.

[0076] After receiving responses from all neighboring processes, the global load baseline is updated using an exponentially decaying average method. .Compare and ,like Then the split decision module is invoked. The module maintains a state machine internally to ensure that it is not triggered repeatedly after each trigger.

[0077] Split Decision Module: This module runs when a pre-split is triggered. It calls `enum_schemes()` to enumerate candidate splitting schemes and selects either dynamic programming or a greedy algorithm based on the number of child nodes. The dynamic programming algorithm uses a two-dimensional array. Store intermediate results.

[0078] For each solution, call delegate_cost() to obtain the delegation cost for each candidate target process. Calculate the splitting benefits .choose The most efficient approach involves calling apply_scheme() to perform the partitioning, including updating the task inheritance tree and recording information about the computation units to be delegated.

[0079] Delegated execution module: This module is responsible for assigning delegate identifiers to target computing units, performing RDMA writes, and reclaiming results. It also maintains the delegate transaction tracking table. A lock-free hash table is used to ensure high-concurrency access, and the hash table uses linear probing to resolve collisions.

[0080] RDMA operations are implemented through the InfiniBandVerbs API, including: ibv_reg_mr() registering a memory region and obtaining the rk, ibv_post_send() sending a WRITE operation, and ibv_poll_cq() polling the completion queue. Modules pass delegation identifiers through shared memory. Shared memory is implemented using the POSIX shared memory interface shm_open and mmap.

[0081] V. Complete Implementation Process Through the above steps, this invention constructs a complete implementation process from task inheritance tree construction, cost prediction, pre-splitting triggering, splitting scheme enumeration, benefit evaluation, target selection, RDMA delegation, computation execution, and result collection. Each process relies only on local information for decision-making and does not engage in global communication; task transfer is achieved using RDMA; and the load balancing benefits and communication costs are balanced through a splitting benefit formula. This implementation eliminates the bottlenecks in traditional parallel computing and improves the resource utilization and overall computational efficiency of high-performance computers.

[0082] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A parallel optimization method for high-performance computers, characterized in that, Includes the following steps: S1: When the grid block currently being handled by the process is refined into sub-grid blocks according to the adaptive grid refinement rules, a local task inheritance tree is constructed for each parallel process; the root node of the task inheritance tree is the grid block currently being handled by the process, and the child nodes are the sub-grid blocks generated by the refinement; the inheritance cost is labeled for each node, and the inheritance cost is the sum of the local computation costs of all nodes in the subtree rooted at that node; S2: Each process only exchanges root node inheritance costs with neighboring processes whose physical distance is less than a preset threshold, and updates the global load baseline in local storage using an exponential decay averaging method; when the difference between the root node inheritance cost and the global load baseline exceeds a dynamic threshold, a pre-splitting of the set of child nodes under the root node of that process is triggered, and the dynamic threshold is linked to the global load baseline. S3: Based on the task inheritance tree of the process that triggered the pre-splitting, enumerate all partitioning schemes of the set of direct child nodes of its root node as candidate partitioning schemes; each partitioning scheme divides the set of child nodes into one or more computing units; S4: For each candidate splitting scheme, select a target process for each computing unit. The target process satisfies the following conditions: its physical distance from the current process is less than a preset distance threshold, and its current load is less than a preset load threshold. The current load is obtained through the computing progress signature exchanged between processes. Then, calculate the splitting benefit. : ; in, The cost of inheritance for the root node; , For the first The sum of the inheritance costs of child nodes in each computing unit. To calculate the number of units; , For the first The sum of the data volume of child nodes in each computing unit For the first The physical distance of the target process corresponding to each computing unit is measured in network hops; These are preset coefficients; S5: Select The largest candidate splitting scheme is the optimal scheme. According to this scheme, the set of child nodes of the root node is divided into multiple computing units. Among them, the computing units of the target process that are not the current process itself are removed from the local task inheritance tree, while the computing units of the target process that are the current process itself are retained. S6: For each computing unit to be delegated to other processes, the current process writes its task metadata into the memory area pre-registered by the target process through a one-sided write operation of remote direct memory access, and generates a globally unique delegate identifier, and records the delegate identifier and timeout timestamp in the delegate transaction tracking table. S7: After the target process completes the computation, it writes the result back to the pre-allocated result storage area of ​​the current process through a one-sided write operation of remote direct memory access, and sets the corresponding completion flag through an atomic operation. S8: After the current process completes each local computation step, it polls the completion flag corresponding to each delegate identifier in the delegated transaction tracking table; when the completion flag is detected to be set, it reads the computation result from the result storage area of ​​the current process and deletes the delegate record; if the completion flag is not detected after the timeout threshold based on the historical computation time estimate, the task is marked as re-delegable and reallocated in the next round of pre-splitting.

2. The parallel optimization method for high-performance computers according to claim 1, characterized in that, The dynamic threshold mentioned in step S2 is determined based on a fixed proportion of the current global load baseline, which is 20% to 50%.

3. The parallel optimization method for high-performance computers according to claim 1, characterized in that, The method for enumerating the partitioning scheme in step S3 is as follows: Number of child nodes ≤ preset threshold When using dynamic programming to traverse all partitioning schemes, the state transition equation is as follows: , For the first The inheritance cost of each child node; Number of child nodes > When the child nodes are sorted in descending order of inheritance cost, they are assigned to the group with the lowest total cost. Then, multiple variant schemes are generated by adjusting the boundary through a sliding window.

4. The parallel optimization method for high-performance computers according to claim 1, characterized in that, Step S4 involves selecting the target process, including: Obtain network topology information to determine physical distances, and obtain the current load of each target process. ; Calculate the cost of the contract ,in In order to achieve the target process physical distance, To calculate the amount of data in a unit, These are preset coefficients; Choose to Minimum target process: , This is the set of candidate target processes.

5. The parallel optimization method for high-performance computers according to claim 1, characterized in that, The polling completion flags in step S8 include: During each local computation time step, the current process checks the completion flag through atomic operations. When the completion flag is set, the computation result is read from the current process's result storage area, and the delegate record in the tracking table is deleted. If the completion flag is not detected after a timeout, the task status is reset to pending delegation and added to the pending re-delegation queue.

6. A parallel optimization system for high-performance computers, characterized in that, include: Task tree building module: used to build a local task inheritance tree for each process during mesh refinement and to label the inheritance cost for each node; The inheritance cost is the sum of the local computation costs of all nodes in the subtree rooted at that node; Pre-split trigger module: used to enable each process to exchange root node inheritance costs with neighboring processes, update the global load baseline using an exponentially decaying average method, and trigger a pre-split when the root node inheritance cost exceeds the sum of the global load baseline and a dynamic threshold; Split Decision Module: Used to enumerate partitioning schemes of the root node's child node set as candidate splitting schemes, using the formula... Calculate the splitting benefit, where For the root node inheritance cost, This represents the maximum sum of the inheritance costs of child nodes in each computational unit after the split. This is a weighted sum of data volume and physical distance. The preset coefficients are used; the scheme with the greatest benefit is selected for division. Delegated execution module: used to select the target process for each computing unit according to the optimal solution, write the task metadata to the target process through RDMA one-sided write operation, and generate and record a unique identifier for each delegated task; After the target process completes, the result is written back via RDMA; After each local computation step is completed, the current process polls the completion flag. If the process fails to complete within a timeout period, it is marked as ready to be re-delegated.

7. The parallel optimization system for high-performance computers according to claim 6, characterized in that, The splitting decision module uses dynamic programming to traverse all partitioning schemes when the number of child nodes is less than or equal to a preset threshold. The state transition equation is as follows: , For the first The inheritance cost of each child node is calculated; when the number of child nodes exceeds a preset threshold, a greedy algorithm is used to allocate them in descending order of inheritance cost, supplemented by a sliding window adjustment.

8. The parallel optimization system for high-performance computers according to claim 6, characterized in that, When selecting a target process, the delegated execution module obtains network topology information to determine the physical distance, obtains the current load of each target process, and calculates the delegation cost. ,in Physical distance To calculate the amount of data in a unit, For the current load, The preset coefficients are used, and the target process with the lowest commission cost is selected.

Citation Information

Patent Citations

  • Task parallelism degree optimization method and device, computer device and storage medium

    CN109885384A

  • Parallel optimization method and system for high-performance computer

    CN117194041A

  • Distributed data processing method and system based on cloud computing

    CN120602486A

  • Gaussian data tree index construction method and device supporting incremental updating and rendering method

    CN121190664A

  • Self-adaptive task scheduling method based on node real-time feedback

    CN121542012A