An adaptive task scheduling method

By adopting the adaptive task scheduling method in the high -performance computing system, the system computing resources are divided into multiple types, and task allocation and recycling through the form of messages solve the problem of imbalance in the computing resource load caused by task scheduling. Resource utilization and solution efficiency.

CN114327808BActive Publication Date: 2025-01-28JIANGNAN INST OF COMPUTING TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110425774.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-20
Publication Date
2025-01-28
Estimated Expiration
2041-04-20

AI Technical Summary

Technical Problem

In high-performance computing systems, improper selection of task scheduling methods leads to unbalanced computing resource load, resulting in waste of computing resources and low solution efficiency.

Method used

A self -adaptive task scheduling method is proposed to divide the system computing resources into global masterpieces, regional main nodes, and leaf computing nodes. The distribution of tasks and dynamic generating tasks through message forms to achieve the balance of task scheduling.

Benefits of technology

Effectively avoid the phenomenon of dynamicly generated tasks in the process of topic operations, which leads to uneven load, and improves the utilization rate and topic solution efficiency of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114327808B_ABST
    Figure CN114327808B_ABST
Patent Text Reader

Abstract

The present invention discloses an adaptive task scheduling method, including initializing computing resources, initializing node types, dividing regions, selecting node types, and initializing task pools when the subject starts to run; performing task allocation and scheduling when the subject is officially running, dynamically generating new tasks and scheduling them as leaf computing nodes complete tasks, when leaf computing nodes complete a certain task calculation and dynamically generate new tasks, the leaf nodes select the first new task to continue calculating, and report the remaining newly generated tasks (if any) to the regional master node through messages, the global master node uses messages to detect the task pools of each region, and when the tasks of a certain region are significantly higher than those of the other regions, the tasks of the region are recycled and enter the dynamic subtask task pool. The present invention can avoid the phenomenon that the dynamically generated tasks in the subject calculation process lead to load imbalance, and improve the utilization rate of computing resources and the efficiency of subject solution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an adaptive task scheduling method, and belongs to the field of high performance computing runtime. Background Art

[0002] High-performance computing systems make it possible to solve large-scale parallel applications in many fields. An important factor that restricts the efficiency of task parallel application projects is the division and scheduling of tasks. If the task scheduling method is not selected properly, a small amount of computing resources will always be busy, while a large amount of computing resources will be idle, resulting in a waste of computing resources and a significant reduction in the efficiency of solving the project.

[0003] The imbalance of the load of each computing resource has always been a major factor affecting the efficiency of parallel projects. This problem is more prominent on high-performance computing platforms with millions of computing cores. For task parallel projects, the reason for the imbalance of the load of each computing core is not only that the task segmentation is not good enough and it is difficult to judge the running time of tasks with many branch judgments, but also that each task may dynamically generate subtasks, such as the following Figure 1 As shown: each CPU was originally responsible for its own original task, but the original task of CPU1 dynamically generated a subtask, and the subtask continued to generate multiple subtasks, so CPU1 was always busy, while other CPUs were idle, resulting in a large amount of computing resource waste.

[0004] Traditional dynamic task scheduling functions can provide dynamic task scheduling for topics that are not interrelated, but some typical applications will dynamically generate new tasks during the task calculation process. When too many tasks are generated in a certain computing core, it will lead to unbalanced task distribution and unbalanced CPU loads, which will seriously affect the efficiency of problem solving.

[0005] The task allocation framework based on task flow graph is not applicable in large-scale heterogeneous many-core systems, especially for task parallel applications where tasks are unrelated to each other, because such applications have unrelated tasks and a huge amount of tasks. At the same time, it is difficult to describe randomly generated subtasks with task flow graphs.

[0006] The task scheduling mechanism based on task stealing often requires each node to share a large memory, but this is not common in heterogeneous many-core systems, especially for heterogeneous many-core systems with millions of computing nodes, where it is difficult to achieve node sharing of large memory.

[0007] The existing dynamic task partitioning framework for heterogeneous multi-core systems takes into account the load imbalance caused by the uncertain execution time of each task, but does not consider the situation where tasks dynamically generate subtasks. Once some tasks continuously and dynamically generate subtasks, it will cause system load imbalance. Summary of the invention

[0008] The purpose of the present invention is to provide an adaptive task scheduling method to solve the problems of unbalanced system load and low efficiency of problem solving that occur during problem calculation.

[0009] To achieve the above purpose, the technical solution adopted by the present invention is: to provide an adaptive task scheduling method, in the subject operation stage, the system computing resources are divided into the following three types: global master node, regional master node, leaf computing node, each node has its own task pool, and the task allocation and dynamic generation task recovery are carried out in the form of messages;

[0010] The global master node has a global total task pool and a dynamic subtask task pool. The initial global total task pool includes all initial tasks of the subject, and the initial dynamic subtask task pool is empty;

[0011] The regional master node has a regional task pool, which is initially empty.

[0012] Leaf computing nodes have leaf node task pools, and the initial leaf node task pool is empty;

[0013] The global master node is used to undertake the following tasks:

[0014] According to the request of each regional master node, the tasks in the global total task pool are dynamically allocated to each regional master node;

[0015] Recover the completion status of task blocks of each regional master node;

[0016] If a region dynamically generates too many subtasks, some of the tasks in the region will be recycled into the dynamic subtask task pool. When the global total task pool is empty and the dynamic subtask task pool is not empty, the tasks in the dynamic subtask task pool will be assigned to the regional master node that sent the task request;

[0017] The regional master node is used to undertake the following tasks:

[0018] When the regional task pool is empty or the task block is less than a certain threshold, apply for tasks from the global master node;

[0019] After receiving the task assignment from the global master node, the task is buffered into the regional task pool;

[0020] Receive task requests from leaf computing nodes and dynamically assign tasks to idle leaf computing nodes from the regional task pool;

[0021] Receive task completion information from leaf computing nodes and record task completion status;

[0022] When a leaf computing node dynamically generates more than one new task, it recycles the task according to the number of tasks in the current regional task pool and the number of all leaf computing nodes in the region, records the task block to which the recycled task belongs, and the recycled task enters the regional task pool;

[0023] When a task block in the regional task pool and its generated subtasks are all completed, the task block is reported to the global master node and a new task block is requested;

[0024] The leaf computing nodes are used to undertake the following tasks:

[0025] When there is no task, apply for a task from the regional master node;

[0026] When more than one new task is dynamically generated during the execution of a task, one of the tasks is retained for further execution, and the remaining tasks are sent back to the regional master node;

[0027] Once the project is up and running, follow these steps:

[0028] S1. Initialize computing resources: initialize node types, divide regions, select global master nodes and regional master nodes, initialize the global total task pool of the global master node to all initial tasks of the subject, the dynamic subtask task pool of the regional master node is empty, and the tasks of the remaining leaf computing nodes are empty;

[0029] S2. Perform task allocation and scheduling:

[0030] When the leaf computing node has no tasks, it requests tasks from the regional master node through messages, and the regional master node assigns tasks in the regional task pool to the leaf computing node through messages;

[0031] When the regional task pool is empty, the regional master node applies for tasks from the global master node through messages, and the global master node assigns tasks from the global total task pool or dynamic subtask task pool to the regional master node;

[0032] S3. Dynamically generate and schedule tasks:

[0033] When a leaf computing node completes the calculation of a task and dynamically generates a new task, the leaf computing node selects the first new task to continue the calculation and reports the remaining newly generated tasks to the regional master node through messages. The regional master node receives the dynamically generated tasks and puts the new tasks into the regional task pool.

[0034] The global master node uses messages to detect the task pools of each region. When the tasks of a certain region are significantly higher than those of other regions, the tasks of that region are recycled and enter the dynamic subtask task pool;

[0035] S4. When all tasks in the global task pool and the dynamic subtask pool have been completed, the subject ends and all tasks are completed.

[0036] The further improved scheme in the above technical scheme is as follows:

[0037] 1. In the above scheme, in S3, the global master node recycles dynamically generated tasks by detection. If the number of subtasks dynamically generated in a certain area is greater than k*(the number of remaining tasks in the global total task pool / the total number of areas), it is considered that the area dynamically generates too many subtasks, and the global master node will recycle the tasks in the regional task pool, where k is an adjustable parameter greater than or equal to 1.

[0038] Due to the application of the above technical solution, the present invention has the following advantages compared with the prior art:

[0039] The present invention is aimed at high-performance computing multi-core or many-core systems, and proposes an adaptive task scheduling method. By considering the recovery and reallocation of newly added subtasks in the dynamic task division process, the system scheduling is made more balanced, and the phenomenon of load imbalance caused by dynamically generated tasks in the problem calculation process can be effectively avoided, thereby effectively improving the utilization rate of computing resources and the efficiency of problem solving. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Attached Figure 1 A schematic diagram of CPU load imbalance caused by dynamic generation of tasks;

[0041] Attached Figure 2 Schematic diagram of the method of the present invention. DETAILED DESCRIPTION

[0042] Embodiment: The present invention provides an adaptive task scheduling method, which is applicable to parallel projects with dynamically growing tasks running on multi-core or many-core computing systems, and achieves load balancing among numerous computing resources by dynamically scheduling original tasks and dynamically generated tasks.

[0043] During the project operation phase, the system computing resources are divided into the following three types: global master node, regional master node, and leaf computing node. Each node has its own task pool, which allocates tasks and recovers dynamically generated tasks in the form of messages.

[0044] The global master node has a global total task pool and a dynamic subtask task pool. The initial global total task pool includes all initial tasks of the subject, and the initial dynamic subtask task pool is empty;

[0045] The regional master node has a regional task pool, which is initially empty.

[0046] Leaf computing nodes have leaf node task pools, and the initial leaf node task pool is empty;

[0047] The global master node is used to undertake the following tasks:

[0048] According to the request of each regional master node, the tasks in the global total task pool are dynamically allocated to each regional master node;

[0049] Recover the completion status of task blocks of each regional master node;

[0050] If a region dynamically generates too many subtasks, some of the tasks in the region will be recycled into the dynamic subtask task pool. When the global total task pool is empty and the dynamic subtask task pool is not empty, the tasks in the dynamic subtask task pool will be assigned to the regional master node that sent the task request;

[0051] The regional master node is used to undertake the following tasks:

[0052] When the regional task pool is empty or the task block is less than a certain threshold, apply for tasks from the global master node;

[0053] After receiving the task assignment from the global master node, the task is buffered into the regional task pool;

[0054] Receive task requests from leaf computing nodes and dynamically assign tasks to idle leaf computing nodes from the regional task pool;

[0055] Receive task completion information from leaf computing nodes and record task completion status;

[0056] When a leaf computing node dynamically generates more than one new task, it recycles the task according to the number of tasks in the current regional task pool and the number of all leaf computing nodes in the region, records the task block to which the recycled task belongs, and the recycled task enters the regional task pool;

[0057] When a task block in the regional task pool and its generated subtasks are all completed, the task block is reported to the global master node and a new task block is requested;

[0058] The leaf computing nodes are used to undertake the following tasks:

[0059] When there is no task, apply for a task from the regional master node;

[0060] When more than one new task is dynamically generated during the execution of a task, one of the tasks is retained for further execution, and the remaining tasks are sent back to the regional master node;

[0061] Once the project is up and running, follow these steps:

[0062] S1. Initialize computing resources: initialize node types, divide regions, select global master nodes and regional master nodes, initialize the global total task pool of the global master node to all initial tasks of the subject, the dynamic subtask task pool of the regional master node is empty, and the tasks of the remaining leaf computing nodes are empty;

[0063] S2. Perform task allocation and scheduling:

[0064] When the leaf computing node has no tasks, it requests tasks from the regional master node through messages, and the regional master node assigns tasks in the regional task pool to the leaf computing node through messages;

[0065] When the regional task pool is empty, the regional master node applies for tasks from the global master node through messages, and the global master node assigns tasks from the global total task pool or dynamic subtask task pool to the regional master node;

[0066] S3. Dynamically generate and schedule tasks:

[0067] When a leaf computing node completes the calculation of a task and dynamically generates a new task, the leaf computing node selects the first new task to continue the calculation and reports the remaining newly generated tasks (if any) to the regional master node through a message. The regional master node receives the dynamically generated tasks and puts the new tasks into the regional task pool.

[0068] The global master node uses messages to detect the task pools of each region. When the tasks of a certain region are significantly higher than those of other regions, the tasks of that region are recycled and enter the dynamic subtask task pool;

[0069] Recycling dynamically generated tasks can effectively reduce the risk of excessive dynamic generation of tasks in a branch, leading to unbalanced computing resource load;

[0070] S4. When all tasks in the global task pool and the dynamic subtask pool have been completed, the subject ends and all tasks are completed.

[0071] In S3, the global master node recycles dynamically generated tasks by detection. If the number of subtasks dynamically generated in a certain area is greater than k*(the number of remaining tasks in the global total task pool / the total number of areas), it is considered that the area has dynamically generated too many subtasks, and the global master node will recycle the tasks in the regional task pool, where k is an adjustable parameter greater than or equal to 1.

[0072] It can support the retention and recovery function. In order to avoid the expansion of the retention and recovery amount as the dynamically generated tasks increase, the original task of the dynamically generated task is marked, and the original task is bundled with the subtasks it generates. The original task will be marked as completed only when the subtask is completed. The breakpoint file only needs to record the unfinished original tasks.

[0073] The idea of ​​partitioning can avoid message congestion. The size of the area can be dynamically adjusted according to the completion time of a single task. If the task time is long, the messages of task allocation and dynamic task generation are not dense, and the area size can be appropriately increased. If the task time is short, the messages of task allocation and dynamic task generation are relatively dense, and the area size can be appropriately reduced.

[0074] The above embodiment is further explained as follows:

[0075] In supercomputer systems, computing resources are very valuable. If there is an imbalance in the load of computing resources, it will greatly restrict the efficiency of solving computing problems and cause a waste of computing resources. Especially when it comes to domestic heterogeneous multi-core parallel computing resources of more than one million levels, this imbalance will result in a huge waste of resources.

[0076] An important type of supercomputing application is task parallelism. This patent is aimed at such task parallelism and unrelated tasks. Most of these tasks have a large number of tasks, and the execution time of each task may vary. When there are no dynamically growing subtasks in the task, dynamic task division can be used to divide the tasks. However, if there are dynamically growing tasks in the system, that is, each task may dynamically generate tasks, then unbalanced task distribution may occur.

[0077] In view of the above phenomenon, combined with the dynamic task scheduling framework for domestic heterogeneous multi-core, this patent proposes an adaptive task scheduling method. This framework is aimed at parallel computing resources of more than one million levels. In order to avoid message congestion caused by excessive local messages, this framework adopts a hierarchical method to divide system computing resources into the following three types:

[0078] The global master node has a global total task pool and a dynamic subtask task pool. The initial global total task pool includes all initial tasks of the subject, and the dynamic subtask task pool is empty.

[0079] The global master node is mainly responsible for the following tasks:

[0080] 1) Dynamically allocate task blocks (usually tasks packaged according to the number of computing resources in the region) from the global total task pool to each regional master node based on the request of each regional master node;

[0081] 2) Recover the completion status of task blocks of each regional master node;

[0082] 3) If a region dynamically generates too many subtasks (the number of subtasks dynamically generated by the region > k* (the number of remaining tasks in the global total task pool / the total number of regions), where k is an adjustable parameter greater than or equal to 1), some of the tasks in the region will be recycled into the dynamic subtask task pool. When the global total task pool is empty and the dynamic subtask task pool is not empty, the tasks in the dynamic subtask task pool will be assigned to the regional master node that sent the task request.

[0083] The regional master node has a regional task pool, which is initially empty.

[0084] The regional master node is mainly responsible for the following tasks:

[0085] 1) When the regional task pool is empty or the task block is less than a certain threshold (usually 2), apply for tasks from the global master node;

[0086] 2) After receiving the task assignment from the global master node, the task is buffered into the regional task pool;

[0087] 3) Receive task requests from leaf computing nodes and dynamically assign tasks to idle leaf computing nodes from the regional task pool;

[0088] 4) Receive task completion information from leaf computing nodes and record task completion status;

[0089] 5) When a leaf computing node dynamically generates more than one new task, it recycles the task according to the number of tasks in the current task pool and the number of all leaf computing nodes in the region, records the task block to which the recycled task belongs, and the recycled task enters the regional task pool;

[0090] 6) When a task block in the regional task pool and its generated subtasks are all completed, report the completion of the task block to the global master node and apply for a new task block.

[0091] Leaf computing nodes have leaf node task pools, which are initially empty.

[0092] The leaf computing nodes are mainly responsible for the following tasks:

[0093] 1) Apply for tasks from the regional master node when there are no tasks;

[0094] 2) When more than one new task is dynamically generated during the execution of a task, one of the tasks is retained for continued execution and the remaining tasks are sent back to the regional master node.

[0095] The above adaptive task scheduling method includes the following key technical points:

[0096] 1. A hierarchical strategy is adopted to avoid message congestion on a certain node. At the same time, the hierarchical strategy expands the imbalance of a single task to all tasks in the entire area. From a probabilistic point of view, the possibility of imbalance in the entire area is much smaller than the imbalance of a single task. Therefore, the newly generated tasks due to imbalance of a single task are likely to be consumed within the area where they are located, which is likely to avoid the regional tasks returning to the global.

[0097] 2. Bundle the original task with the subtasks it generates. The original task will be marked as completed only when the subtasks are completed. The advantages are: 1) The global master node only needs to determine whether the initial tasks are completed to determine whether all tasks are completed; 2) When recording breakpoint files, only the original task needs to be recorded, and there is no need to record the numerous subtasks that may be generated. When the system encounters an unexpected problem and causes certain point failures, the restart program only needs to read the breakpoint files related to the original task to ensure that all tasks can be executed without omissions.

[0098] Introducing a hierarchical task recovery and redistribution strategy, by dividing the system nodes into management nodes and leaf computing nodes in a hierarchical manner, and deploying tasks through the management nodes;

[0099] Through the layered strategy, message congestion is avoided, and newly added tasks are completed in the local area as much as possible, avoiding a large number of long-distance messages; by controlling the number of nodes in different layers, the framework can achieve controllable costs; it can effectively avoid the imbalance of system load caused by the dynamic growth of tasks and improve the efficiency of problem solving.

[0100] The framework is transparent to users. Users only need to call the functions provided by the framework in the loop for task allocation without modifying the program, which increases user usability.

[0101] When using the above-mentioned adaptive task scheduling method, it proposes an adaptive task scheduling method for domestic heterogeneous multi-core systems. By considering the recovery and redistribution of newly added subtasks in the dynamic task division process, the system scheduling is more balanced. It can effectively avoid the phenomenon of load imbalance caused by dynamically generated tasks during the subject calculation process, and effectively improve the utilization of computing resources and the efficiency of subject solving.

[0102] In order to facilitate a better understanding of the present invention, the terms used in this article are briefly explained below:

[0103] Dynamic growth of tasks: In some task-parallel projects, a task assigned to a computing core may generate one or more subtasks. That is, the total number of tasks is not fixed, but grows dynamically based on meeting certain conditions.

[0104] Load balancing: In a heterogeneous many-core system, when all computing cores can be evenly or relatively evenly assigned tasks during the execution of a certain task, the computing system is said to be load balanced.

[0105] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. An adaptive task scheduling method, characterized in that: During the project operation phase, the system computing resources are divided into the following three types: global master node, regional master node, and leaf computing node. Each node has its own task pool, which allocates tasks and recovers dynamically generated tasks in the form of messages. The global master node has a global total task pool and a dynamic subtask task pool. The initial global total task pool includes all initial tasks of the subject, and the initial dynamic subtask task pool is empty; The regional master node has a regional task pool, which is initially empty. Leaf computing nodes have leaf node task pools, and the initial leaf node task pool is empty; The global master node is used to undertake the following tasks: According to the request of each regional master node, the tasks in the global total task pool are dynamically allocated to each regional master node; Recover the completion status of task blocks of each regional master node; If a region dynamically generates too many subtasks, some of the tasks in the region will be recycled into the dynamic subtask task pool. When the global total task pool is empty and the dynamic subtask task pool is not empty, the tasks in the dynamic subtask task pool will be assigned to the regional master node that sent the task request; The regional master node is used to undertake the following tasks: When the regional task pool is empty or the task block is less than a certain threshold, apply for tasks from the global master node; After receiving the task assignment from the global master node, the task is buffered into the regional task pool; Receive task requests from leaf computing nodes and dynamically assign tasks to idle leaf computing nodes from the regional task pool; Receive task completion information from leaf computing nodes and record task completion status; When a leaf computing node dynamically generates more than one new task, it recycles the task according to the number of tasks in the current regional task pool and the number of all leaf computing nodes in the region, records the task block to which the recycled task belongs, and the recycled task enters the regional task pool; When a task block in the regional task pool and its generated subtasks are all completed, the task block is reported to the global master node and a new task block is requested; The leaf computing nodes are used to undertake the following tasks: When there is no task, apply for a task from the regional master node; When more than one new task is dynamically generated during the execution of a task, one of the tasks is retained for further execution, and the remaining tasks are sent back to the regional master node; Once the project is up and running, follow these steps: S1. Initialize computing resources: initialize node types, divide regions, select global master nodes and regional master nodes, initialize the global total task pool of the global master node to all initial tasks of the subject, the dynamic subtask task pool of the regional master node is empty, and the tasks of the remaining leaf computing nodes are empty; S2. Perform task allocation and scheduling: When the leaf computing node has no tasks, it requests tasks from the regional master node through messages, and the regional master node assigns tasks in the regional task pool to the leaf computing node through messages; When the regional task pool is empty, the regional master node applies for tasks from the global master node through messages, and the global master node assigns tasks from the global total task pool or dynamic subtask task pool to the regional master node; S3. Dynamically generate and schedule tasks: When a leaf computing node completes the calculation of a task and dynamically generates a new task, the leaf computing node selects the first new task to continue the calculation and reports the remaining newly generated tasks to the regional master node through messages. The regional master node receives the dynamically generated tasks and puts the new tasks into the regional task pool. The global master node uses messages to detect the task pools of each region. When the tasks of a certain region are significantly higher than those of other regions, the tasks of that region are recycled and enter the dynamic subtask task pool; S4. When all tasks in the global task pool and the dynamic subtask pool have been completed, the subject ends and all tasks are completed.

2. The adaptive task scheduling method according to claim 1, characterized in that: In S3, the global master node recycles dynamically generated tasks by detection. If the number of subtasks dynamically generated in a certain area is greater than k*(the number of remaining tasks in the global total task pool / the total number of areas), it is considered that the area has dynamically generated too many subtasks, and the global master node will recycle the tasks in the regional task pool, where k is an adjustable parameter greater than or equal to 1.

Citation Information

Patent Citations

  • Distributed task scheduling operation and maintenance monitoring system and method

    CN106484530A

  • Runtime computing resource dynamic extension method

    CN112631693A