CN102929707A - Parallel task dynamical allocation method - Google Patents
Parallel task dynamical allocation method Download PDFInfo
- Publication number
- CN102929707A CN102929707A CN2012104382646A CN201210438264A CN102929707A CN 102929707 A CN102929707 A CN 102929707A CN 2012104382646 A CN2012104382646 A CN 2012104382646A CN 201210438264 A CN201210438264 A CN 201210438264A CN 102929707 A CN102929707 A CN 102929707A
- Authority
- CN
- China
- Prior art keywords
- task
- consumer
- host process
- allocated
- host
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Multi Processors (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a parallel task dynamical allocation method which is suitable for a parallel system including a multilevel user process. The multilevel user process comprises at least two levels of main processes and common processes. The method includes that the main processes arrange parallel tasks to be allocated to form task queues to be allocated at the local level, task request information and the number of requested tasks sent by a next level of user processes are received, beginning from heads of the task queues to be allocated at the local level, the tasks are allocated to a next level of user processes according to the number of the requested tasks of the next level of user processes, and the task queues to be allocated at the local level are updated. The parallel task dynamical allocation method has the advantages that the efficiency of dynamical task allocation can be improved, and the load balance among mass computing resources is achieved.
Description
Technical field
The present invention relates to high-performance computing sector, relate in particular to the parallel task dynamic allocation method under a kind of large-scale parallel environment.
Background technology
Under the large-scale parallel environment, the computational resource that concurrent application is faced is numerous, Communication Highlights easily occurs, produces the load imbalance phenomenon, causes the dynamic task allocation service performance sharply to descend, thereby affects the whole efficiency of application program.Therefore, in the parallel language operational system, how efficiently to realize calculation task to the dynamic mapping of computational resource to reach the load balance between numerous computational resources, guarantee the concurrent application optimized performance, become one of technical matters that those skilled in the art need to be resolved hurrily.Under extensive environment, realize dynamic task allocation, thereby have influence on application program capacity,
For tasks in parallel class problem, realize dynamic task allocation, the most direct mode is that the user utilizes the concurrent messages built-in function to write corresponding control program, for example at MPI(program message passing model, Message Passing Interface) in the program, selects a host process, be generally RANK0 as Master, other processes send task requests message to this process, and Master provides the task distribution services according to the current task implementation status to other processes.But the shortcoming of this implementation is: 1) user writes task control program and has certain difficulty, realizes comparatively complicated; 2) extensibility existing problems, on massively parallel system, consumer process is thousands of, and the Master burden is heavier, and the integral body that affects program is carried out efficient.
In addition, the computational resource of large-scale parallel environment is numerous, the phenomenon of computational resource fault often occurs.Therefore, how guaranteeing concurrent program with less fault-tolerant cost in the situation that computational resource breaks down and continue execution, also is the technical matters that those skilled in the art need to be resolved hurrily.
Aspect fault-tolerant, the checkpoint technology is one of the most common means.The checkpoint technology refers to when user program is carried out certain phase, and the memory mapping that active user's program is carried out remains to disk, when fault occurs, reads the memory mapping of a nearest checkpoint, reruns user program from this point.The checkpoint fault-tolerant technique need to keep the memory mapping of complete routine, and cost is higher, and the problem of big data quantity, and the content that need to keep is more, for the I/O ability of platform high requirement is arranged.In addition, when having computational resource to break down, can only return to nearest before this checkpoint, the loss that fault produces is larger.
Summary of the invention
Technical matters to be solved by this invention is to improve the efficient of dynamic task allocation, to reach the load balance between numerous computational resources.
In order to address the above problem, the invention provides a kind of parallel task dynamic allocation method, be applicable to comprise the parallel system of multi-stage user process; Described multi-stage user process comprises at least two-stage host process and common process; The method comprises:
The parallel task ordering that described host process is to be allocated with the corresponding levels forms task queue to be allocated at the corresponding levels;
Described host process receives the task requests message of next stage consumer process transmission and the task quantity of asking;
Described host process is from the head of the queue of corresponding levels task queue to be allocated, and the task quantity according to the next stage consumer process is asked is next stage consumer process allocating task, and upgrades task queue to be allocated at the corresponding levels.
Optionally, the method also comprises:
Described host process according to the processing power of described host process itself, is the host process allocating task from the head of the queue of corresponding levels task queue to be allocated, and upgrades task queue to be allocated at the corresponding levels; In the process that is the host process allocating task, suspend and be next stage consumer process allocating task.
Optionally, also comprise:
If the task quantity of asking is greater than the task quantity in the task queue to be allocated of the described corresponding levels, the described host process task quantity that sends task requests message and ask to its upper level consumer process is then upgraded the task queue to be allocated of the described corresponding levels after receiving the task that the upper level consumer process distributes.
Optionally, the method also comprises:
If described consumer process receive and the process of executing the task in break down, then breaking down of task is reclaimed, and is discharged to the tail of the queue of the task queue to be allocated that the consumer process that distributes this task manages, distribute with again participation task.
Optionally, described host process comprises overall host process and regional host process;
Described multi-stage user process comprises overall host process, at least level-1 area host process and common process;
Described overall host process, level-1 area host process and common process are tree-shaped and arrange at least; Wherein, overall host process is root node; The zone host process is branch node; Common process is leafy node.
Optionally, in the parallel task ordering that the corresponding levels are to be allocated of described primary user's process, form before the task queue to be allocated, also comprise:
With all consumer process according to overall host process, level-1 area host process and common process are divided into the multi-stage user process at least.
Optionally, described with all consumer process according to overall host process, level-1 area host process and common process are divided into the multi-stage user process and comprise at least:
Choose the consumer process as overall host process;
With other consumer process groupings; In each group, choose the consumer process as regional host process;
Remaining consumer process is common process.
Optionally, described the grouping of other consumer process is comprised:
Consumer process except overall host process is divided into groups to form the level-1 area host process;
Perhaps the consumer process except overall host process is divided into groups to form the level-1 area host process, and in the consumer process group that grouping forms afterwards, divide into groups step by step again, to be formed with the up and down multistage regional host process of subordinate relation.
Optionally, the described consumer process of choosing as overall host process comprises that the consumer process of choosing the logical process minimum is overall host process;
The described consumer process of in each group, choosing as regional host process comprise select logical process minimum in each group consumer process be regional host process.
Optionally, the method also comprises:
Described overall host process records the distribution condition of all tasks, and the task performance of returning according to the consumer process that receives task, record breakpoint file;
Described regional host process records the distribution condition of task to be allocated at the corresponding levels, and according to the task performance that the consumer process that receives task returns, returns task performance at the corresponding levels to its upper level consumer process;
Described common process is returned the task performance of common process itself to its upper level consumer process.
Optionally, the method also comprises:
If described common process breaks down, the task of then will distribute to this common process reclaims, and is discharged to the tail of the queue of task queue to be allocated of the regional host process management of its upper level, and again participation task is distributed;
If described regional host process breaks down, the task of then will distribute to this zone host process reclaims, and is discharged to the tail of the queue of task queue to be allocated of the consumer process management of its upper level, and again participation task is distributed; And from the consumer process of this zone host process next stage, select new regional host process, continue as next stage consumer process allocating task;
When described overall host process breaks down, from the regional host process of its next stage, select new overall host process, read described breakpoint file, continue to distribute Unrecorded not the finishing the work of described breakpoint file.
Optionally, in the parallel task ordering that the corresponding levels are to be allocated of described host process, form before the task queue to be allocated at the corresponding levels, also comprise:
Carry out initialization; Described initialization comprises: record breakpoint filename, record general assignment number, logger task block size.
Optionally, the once task quantity of asking of described common process is a task block size;
The product that the once task quantity of asking of described regional host process is a task block size and all consumer process numbers of its subordinate;
Optionally, in the parallel task ordering that the corresponding levels are to be allocated of described host process, form before the task queue to be allocated at the corresponding levels, also comprise: for each task is distributed unique task number;
Described allocating task comprises: the task number that provides institute's allocating task.
Optionally, also comprise: after the task queue to be allocated of overall host process, increase by an end mark;
When the task number that receives was described end mark, parallel task assigned.
Compared with prior art, technical scheme of the present invention has the following advantages:
1, the present invention is by the multilayer dynamic task allocation pattern based on queue theory model, with the dynamic task allocation service distribution to a plurality of computational resources, reduced the cost of dynamic task allocation, Effective Raise the efficient of task distribution services, thereby avoided the generation of service hot spot, reached the load balance between numerous computational resources.
2, in the possibility, by consumer process being divided into groups to form tree-like arranging, more simplify higher level's consumer process to subordinate's consumer process and to the management of task.
3, in the possibility, by the situation of distributing in service end record current task, in the situation that the part computational resource breaks down, the task of distributing to the fault resource is reclaimed, reassign to healthy computational resource, to guarantee that concurrent application can continue correct execution, fault-tolerant efficient is provided, the impact that simultaneously the fault resource is brought is confined to certain scope.In addition, the loss that brings of the effective Reduction of failure resource of upgrading in time also of breakpoint file.
Description of drawings
Fig. 1 is the process flow diagram of the first embodiment of parallel task dynamic allocation method of the present invention;
Fig. 2 is the process flow diagram of the second embodiment of parallel task dynamic allocation method of the present invention;
Fig. 3 is the process flow diagram of the 3rd embodiment of parallel task dynamic allocation method of the present invention;
Fig. 4 is the process flow diagram of the 4th embodiment of parallel task dynamic allocation method of the present invention;
Fig. 5 is the process flow diagram that step is divided into all consumer process one embodiment of multi-stage user process in the parallel task dynamic allocation method of the present invention;
Fig. 6 is each stage schematic diagram of the first embodiment of corresponding diagram 5 embodiments;
Fig. 7 is each stage schematic diagram of the second embodiment of corresponding diagram 5 embodiments;
Fig. 8 is the process flow diagram of the 5th embodiment of parallel task dynamic allocation method of the present invention;
Fig. 9 is each stage schematic diagram of the first embodiment of parallel task dynamic allocation method of the present invention;
Figure 10 is each stage schematic diagram of the second embodiment of parallel task dynamic allocation method of the present invention;
Figure 11 is each stage schematic diagram of the 3rd embodiment of parallel task dynamic allocation method of the present invention;
Figure 12 is each stage schematic diagram of the 4th embodiment of parallel task dynamic allocation method of the present invention;
Figure 13 is each stage schematic diagram of the 5th embodiment of parallel task dynamic allocation method of the present invention.
Figure 14 is each stage schematic diagram of the 6th embodiment of parallel task dynamic allocation method of the present invention.
Embodiment
A lot of details have been set forth in the following description so that fully understand the present invention.But the present invention can implement much to be different from alternate manner described here, and those skilled in the art can be in the situation that do similar popularization without prejudice to intension of the present invention, so the present invention is not subjected to the restriction of following public implementation.
Secondly, the present invention utilizes schematic diagram to be described in detail, and when the embodiment of the invention was described in detail in detail, for ease of explanation, described schematic diagram was example, and it should not limit the scope of protection of the invention at this.
Application background of the present invention is tasks in parallel class problem, and namely problem is comprised of numerous sub-tasks, does not have correlativity between each subtask, and the correctness of problem is with the complete precondition that is implemented as of each subtask.
In order to solve the technical matters in the background technology, the invention provides a kind of parallel task dynamic allocation method, Fig. 1 is the process flow diagram of the first embodiment of parallel task dynamic allocation method of the present invention.As described in Figure 1, this embodiment may further comprise the steps:
Execution in step S101, the parallel task ordering that host process is to be allocated with the corresponding levels forms task queue to be allocated at the corresponding levels.The present invention passes through at many levels dynamically allocating task, can effectively alleviate the host process Communication Highlights problem that all tasks are all caused by unique host process distribution in the prior art.
Particularly, host process comprises that overall host process reaches at least regional host process of one-level.Described overall host process, level-1 area host process and common process are tree-shaped and arrange at least.Wherein, overall host process is root node; The zone host process is branch node; Common process is leafy node.Comprise all parallel tasks to be allocated in the task queue to be allocated of described overall host process, the task in the task queue to be allocated of each regional host process is that its upper level consumer process (overall host process or regional host process) is the parallel task of its distribution.
Need to prove, it will be understood by those skilled in the art that described parallel task, can be by different processor executed in parallel for there not being the task of correlativity between mutual.Under the large-scale parallel environment, a calculating problem is broken down into a plurality of parallel tasks usually, and the correctness of problem is with the complete precondition that is implemented as of each parallel task.
Need to prove, the present invention is not specifically limited the progression of regional host process, and operating personnel can consider on the basis of expense of efficient that task distributes and storage space, task management and decide in its sole discretion.In principle, the progression of regional host process is more, and the efficient that task is distributed is higher, and simultaneously required storage space and the expense in the task management are also larger.
The described parallel task that the corresponding levels are to be allocated ordering can comprise: the task number according to corresponding levels parallel task to be allocated sorts from small to large, but the present invention is not specifically limited this, those skilled in the art can understand, various sortords all can be applicable to the present invention in the prior art, and are not superfluous at this.
Execution in step S102, host process receives the task requests message of next stage consumer process transmission and the task quantity of asking.Particularly, host process is only accepted the task requests of its next stage consumer process transmission and the task quantity of asking.Take the parallel system that comprises overall host process, level-1 area host process and 3 grades of consumer process of common process as example, overall host process is only accepted the task requests that the level-1 area host process sends and the task quantity of asking.If common process application task then can only be to its upper level consumer process (being the level-1 area host process) transmission task requests and the task quantity of asking.Take the parallel system that comprises overall host process, level-1 area host process, level-2 area host process and 4 grades of consumer process of common process as example, then overall host process is only accepted the task requests of level-1 area host process, the level-1 area host process is only accepted the task requests of level-2 area host process, and the level-2 area host process is accepted the task requests of common process.By the way, can effectively control traffic load amount between every grade of consumer process and its superior and the subordinate's consumer process.
Execution in step S103, host process is from the head of the queue of corresponding levels task queue to be allocated, and the task quantity according to the next stage consumer process is asked is next stage consumer process allocating task, and upgrades task queue to be allocated at the corresponding levels.Particularly, the present invention adopts the mode of first-in first-out (FIFO), is next stage consumer process allocating task.Overall situation host process is only to its next stage consumer process (that is: level-1 area host process) allocating task, and each regional host process is also only to its next stage consumer process allocating task.The task quantity that described next stage consumer process is asked comprises: but determine the task quantity of once request with the task quantity of parallel processing.Still take the parallel system that comprises overall host process, level-1 area host process and 3 grades of consumer process of common process as example.Such as: 2 level-1 area host processes are arranged under the overall host process, 50 common processes are arranged under each level-1 area host process, each common task parallelism task processing power is 10 tasks.Then a common process is 10 to the once task quantity of asking of level-1 area host process, and level-1 area host process is 500 (that is: 10 * 50, task quantity * process number) to the once task quantity of asking of overall host process.Described renewal task queue to be allocated at the corresponding levels comprises: will having distributed of task shifts out from the task queue to be allocated of the described corresponding levels, makes only to comprise unappropriated task at the corresponding levels in the task queue to be allocated of the described corresponding levels.
The present invention will originally concentrate on the task of overall host process and distribute, and various dimensions transfer at many levels that multi-stage user process (that is: overall host process and regional host process) is common distributes, Effective Raise the task efficient of distributing.Simultaneously, based on the task allocation model of queue theory model, so that the cost of dynamic task allocation is lower, efficient is higher.
Fig. 2 is the process flow diagram of the second embodiment of parallel task dynamic allocation method of the present invention.Different from the first embodiment is that host process itself also participates in executing the task except being the next stage consumer process allocating task in this embodiment.And in this embodiment, before being next stage consumer process allocating task, can be first whether corresponding levels task to be allocated be satisfied task quantity that the next stage consumer process asks and do one and estimate, on the basis of satisfying, just the next stage consumer process is carried out task and distribute; If do not satisfy, then elder generation, is carried out task to the next stage consumer process again and distributes behind its upper level consumer process request task by host process.
As described in Figure 2, this embodiment may further comprise the steps:
Execution in step S201, the parallel task ordering that host process is to be allocated with the corresponding levels forms task queue to be allocated at the corresponding levels.
Can select to be implemented as next stage consumer process allocating task, perhaps be the allocating task of host process own.That is: in the untaxed situation of service that task is distributed, host process itself also participates in executing the task except being the next stage consumer process allocating task.
If next stage consumer process allocating task, then execution in step S202 receives the task requests message of next stage consumer process transmission and the task quantity of asking.
Continue execution in step S203, judge that whether the task quantity of asking is greater than the task quantity in the corresponding levels task queue to be allocated, that is: in this embodiment, be not just to upper level consumer process request task after corresponding levels task to be allocated all assigns, but must satisfy a task requests quantity of next stage consumer process, in the time of can't satisfying to upper level consumer process request task.Still take the aforementioned parallel system of overall host process, level-1 area host process and 3 grades of consumer process of common process that comprises as example.Common process is 10, one level-1 area host processes to the once task quantity of asking of overall host process to the once task quantity of asking of level-1 area host process is 500 (that is: 10 * 50, task quantity * process number).When a common process during to level-1 area host process request task, whether the number of tasks in the task queue to be allocated of first judgement this level-1 area host process this moment satisfies 10, distribute if satisfy, otherwise first behind overall host process request task, again to this common course allocation task by this level-1 area host process.
If the task quantity of asking is greater than the task quantity in the corresponding levels task queue to be allocated, execution in step S204 then, the task quantity that sends task requests message and ask to the upper level consumer process, after the task of receiving the distribution of upper level consumer process, upgrade the task queue to be allocated of the described corresponding levels, that is: with behind the task ranking that receives, add the tail of the queue of described corresponding levels task queue to be allocated.Then returning step S203 continues to carry out.
If the task quantity of asking is less than or equal to the task quantity in the task queue to be allocated at the corresponding levels, execution in step S205 then, from the head of the queue of corresponding levels task queue to be allocated, the task quantity according to the next stage consumer process is asked is next stage consumer process allocating task.Execution in step S206 upgrades task queue to be allocated at the corresponding levels, that is: will having distributed of task shifts out from the task queue to be allocated of the described corresponding levels.
If the allocating task of host process own, the task distribution conflict for avoiding simultaneously host process and next stage consumer process allocating task are caused then, first execution in step S207 suspends and is next stage consumer process allocating task.Execution in step S208 from the head of the queue of corresponding levels task queue to be allocated, according to the processing power of host process, is the allocating task of host process own.Particularly, owing to being that host process is self allocating task, task queue to be allocated is kept at this locality, and host process can know whether enough task quantity to be allocated self is still arranged, therefore when being the allocating task of host process own, need not to inquire whether task quantity to be allocated satisfies distribution requirements.Execution in step S209 upgrades task queue to be allocated at the corresponding levels, that is: will having distributed of task shifts out from the task queue to be allocated of the described corresponding levels.Execution in step S210 reverts to next stage consumer process allocating task.
Continue execution in step S211, judge whether all tasks all distribute complete.If then finish.Otherwise, return step S202 or step S207, continue allocating task.
Fig. 3 is the process flow diagram of the 3rd embodiment of parallel task dynamic allocation method of the present invention.Different from the second embodiment is, also introduce fault tolerant mechanism in this embodiment, that is: when consumer process breaks down, abandoned the consumer process of fault, and reclaim the task of having distributed to the failed subs criber process, redistribute the consumer process to health.
As described in Figure 3, this embodiment may further comprise the steps:
Execution in step S301, the parallel task ordering that host process is to be allocated with the corresponding levels forms task queue to be allocated at the corresponding levels.
Can select to be implemented as next stage consumer process allocating task, perhaps be the allocating task of host process own.If next stage consumer process allocating task, then execution in step S302 receives the task requests message of next stage consumer process transmission and the task quantity of asking.Execution in step S303 judges that whether the task quantity of asking is greater than the task quantity in the corresponding levels task queue to be allocated.If the task quantity of asking is greater than the task quantity in the corresponding levels task queue to be allocated, execution in step S304 then, the task quantity that sends task requests message and ask to the upper level consumer process, after the task of receiving the distribution of upper level consumer process, upgrade the task queue to be allocated of the described corresponding levels, then return step S303 and continue to carry out.If the task quantity of asking is less than or equal to the task quantity in the task queue to be allocated at the corresponding levels, execution in step S305 then, from the head of the queue of corresponding levels task queue to be allocated, the task quantity according to the next stage consumer process is asked is next stage consumer process allocating task.Execution in step S306 upgrades task queue to be allocated at the corresponding levels.
If the allocating task of host process own, execution in step S307 then suspends and is next stage consumer process allocating task.Execution in step S308 from the head of the queue of corresponding levels task queue to be allocated, according to the processing power of host process, is the allocating task of host process own.Execution in step S309 upgrades task queue to be allocated at the corresponding levels.Execution in step S310 reverts to next stage consumer process allocating task.
Whether execution in step S311 judges in consumer process reception and the process of executing the task and breaks down.Particularly, can be notified by system supervisor the physical location of the computational resource that the base layer support system breaks down, the base layer support system determines the logical number of the resource that breaks down by replacing.
If fault has occured, then execution in step S312 reclaims breaking down of task, and is discharged to the tail of the queue of the task queue to be allocated of the consumer process management that distributes this task, distributes with again participation task, returns step S302 or step S307, continues allocating task.If do not break down, then execution in step S313 judges whether all tasks all distribute complete.If then finish.Otherwise, return step S302 or step S307, continue allocating task.
Need to prove, this embodiment also can comprise: described overall host process records the distribution condition of all tasks, and according to the task performance that the consumer process that receives described task returns, records the breakpoint file; Described regional host process records the distribution condition of task to be allocated at the corresponding levels, and according to the task performance that the consumer process that receives described task returns, returns task performance at the corresponding levels to its upper level consumer process; Described common process is returned the task performance of common process itself to its upper level consumer process.Particularly, described breakpoint file record being finished of task, be used for when described overall host process breaks down, returning to nearest before this milestone point, to continue correct execution.Described record breakpoint file can be the time recording breakpoint, and perhaps completed task records breakpoint after building up to some, also or with both combines, and namely records breakpoint one time as long as satisfy arbitrary situation, and the present invention is not specifically limited this.
Accordingly, this embodiment also can comprise: if described common process breaks down, the task of then will distribute to this common process reclaims, and is discharged to the tail of the queue of task queue to be allocated of the regional host process management of its upper level, and again participation task is distributed; If described regional host process breaks down, the task of then will distribute to this zone host process reclaims, and is discharged to the tail of the queue of task queue to be allocated of the consumer process management of its upper level, and again participation task is distributed; And from the consumer process of this zone host process next stage, select new regional host process, continue as next stage consumer process allocating task; When described overall host process breaks down, from the regional host process of its next stage, select new overall host process, read described breakpoint file, continue to distribute Unrecorded not the finishing the work of described breakpoint file.
Particularly, if certain common process breaks down, then abandon this resource, it no longer is its allocating task, owing to preserving the task performance of this common process in the regional host process of its upper level, can should the uncompleted task of common process continue to distribute to other common processes execution by this zone host process simultaneously.If certain regional host process breaks down, then from the consumer process of its next stage, select new regional host process, continue as next stage consumer process allocating task, owing to preserving the task performance of this fault zone host process in the consumer process of its upper level (upper level zone host process or overall host process), can continue to distribute the uncompleted task of this fault zone host process by this upper level consumer process simultaneously.If overall host process breaks down, then need from the regional host process of its next stage, to select new overall host process, read simultaneously the breakpoint file of record, to return to nearest milestone state, continue to distribute and do not finish the work.
Fig. 4 is the process flow diagram of the 4th embodiment of parallel task dynamic allocation method of the present invention.Different from the 3rd embodiment is that this embodiment increased the consumer process classification in beginning, to form the step of multi-stage user process.As described in Figure 4, this embodiment may further comprise the steps:
Execution in step S401, with all consumer process according to overall host process, level-1 area host process and common process are divided into the multi-stage user process at least.
Execution in step S402, the parallel task ordering that host process is to be allocated with the corresponding levels forms task queue to be allocated at the corresponding levels.
Can select to be implemented as next stage consumer process allocating task, perhaps be the host process allocating task.If next stage consumer process allocating task, then execution in step S403 receives the task requests message of next stage consumer process transmission and the task quantity of asking.Execution in step S404 judges that whether the task quantity of asking is greater than the task quantity in the corresponding levels task queue to be allocated.If the task quantity of asking is greater than the task quantity in the corresponding levels task queue to be allocated, execution in step S405 then, the task quantity that sends task requests message and ask to the upper level consumer process, after the task of receiving the distribution of upper level consumer process, upgrade the task queue to be allocated of the described corresponding levels, then return step S404 and continue to carry out.If the task quantity of asking is less than or equal to the task quantity in the task queue to be allocated at the corresponding levels, execution in step S406 then, from the head of the queue of corresponding levels task queue to be allocated, the task quantity according to the next stage consumer process is asked is next stage consumer process allocating task.Execution in step S407 upgrades task queue to be allocated at the corresponding levels.
If the host process allocating task, execution in step S408 then suspends and is next stage consumer process allocating task.Execution in step S409 from the head of the queue of corresponding levels task queue to be allocated, according to the processing power of host process, is the allocating task of host process own.Execution in step S410 upgrades task queue to be allocated at the corresponding levels.Execution in step S411 reverts to next stage consumer process allocating task.
Execution in step S412, judge in consumer process reception and the process of executing the task whether break down, if fault has occured, execution in step S413 then, breaking down of task is reclaimed, and be discharged to the tail of the queue of the task queue to be allocated of the consumer process management that distributes this task, distribute with again participation task, return step S403 or step S408, continue allocating task.If do not break down, then execution in step S414 judges whether all tasks all distribute complete.If then finish.Otherwise, return step S403 or step S408, continue allocating task.
Fig. 5 is the process flow diagram that step is divided into all consumer process one embodiment of multi-stage user process in the parallel task dynamic allocation method of the present invention.As described in Figure 5, this embodiment may further comprise the steps:
Execution in step S4011 chooses the consumer process as overall host process.Particularly, the consumer process of optional fetch logic process number minimum is overall host process, but the present invention does not do concrete restriction to this.Those skilled in the art can be according to the selected overall host process of other rules, such as: take what or the physical location of process in communication network of resource etc. according to process.
Execution in step S4012 with other consumer process groupings, chooses the consumer process as regional host process in each group.
Particularly, described other users are divided into groups to comprise: the consumer process except overall host process is divided into groups to form level-1 area host process (that is: totally 3 grades of consumer process, the first order is overall host process, the second level is the level-1 area host process, the third level is common process), perhaps the consumer process except overall host process is divided into groups to form the level-1 area host process, and in the consumer process group that grouping forms afterwards, divide into groups step by step again, to be formed with up and down the multistage regional host process of subordinate relation (that is: n level consumer process altogether, n〉3, the first order is overall host process, second to (n-1) the multistage regional host process for subordinate relation about having, and the n level is common process).
The described consumer process of in each group, choosing as regional host process comprise select logical process minimum in each group consumer process be regional host process, but the present invention does not do concrete restriction to this.Those skilled in the art can be according to other regular selection area host processes, such as: according to the process priority of Time Created, or the physical location of process in communication network etc.
Execution in step S4013, remaining consumer process is common process.
Below in conjunction with the drawings and specific embodiments " with the consumer process classification " step among the present invention is described further.
Fig. 6 is each stage schematic diagram of the first embodiment of corresponding diagram 5 embodiments.
With reference to STEP1 among the figure 6, one has 100 processes in the present embodiment, and its logical process number is respectively 0 ~ 99.
Continuation is with reference to STEP2 among the figure 6, chooses wherein that the process of logical process minimum (that is: process 0) is overall host process, these 100 processes is divided into 2 grades, that is: overall host process (process 0) and other consumer process (process 1 ~ 99).
Continuation is divided into groups to other consumer process (process 1 ~ 99) with reference to STEP3 among the figure 6, is divided into 2 groups.Consumer process group (process 1 ~ 45) is first group, and consumer process group (process 46 ~ 99) is second group.
Continuation is with reference to STEP4 among the figure 6, and the process (that is: process 1) of choosing the logical process minimum in first group is regional host process, and remaining process is (process 2 ~ 45) common process.The process (that is: process 46) of choosing the logical process minimum in second group is regional host process, and remaining process is (process 47 ~ 99) common process.
So far, all consumer process classifications are complete, formed 3 grades of consumer process that comprise 1 overall host process, 2 regional host processes and other 97 common processes.
Fig. 7 is each stage schematic diagram of the second embodiment of corresponding diagram 5 embodiments.Different from last embodiment is by step by step grouping in the group, to have formed the multi-stage user process in the present embodiment.
With reference to STEP1 ' among the figure 7,100 processes are arranged in the present embodiment equally, its logical process number is respectively 0 ~ 99.
Continuation is with reference to STEP2 ' among the figure 7, chooses wherein that the process of logical process minimum (that is: process 0) is overall host process, these 100 processes is divided into 2 grades, that is: overall host process (process 0) and other consumer process (process 1 ~ 99).
Continuation is divided into groups to other consumer process (process 1 ~ 99) with reference to STEP3 ' among the figure 7, is divided into 2 groups.Consumer process group (process 1 ~ 45) is first group, and consumer process group (process 46 ~ 99) is second group.
Continuation is with reference to STEP4 ' among the figure 7, and the process (that is: process 1) of choosing the logical process minimum in first group is the level-1 area host process, and forms first user process group (process 2 ~ 45).The process (that is: process 46) of choosing the logical process minimum in second group is the level-1 area host process, and forms the second consumer process group (process 47 ~ 99).
Continuation is divided into groups to first user process group (process 2 ~ 45) with reference to STEP5 ' among the figure 7 again, is divided into 2 groups, and consumer process group (process 2 ~ 30) is first group, and consumer process group (process 31 ~ 45) is second group; The second consumer process group (process 47 ~ 99) is divided into groups again, be divided into 2 groups, consumer process group (process 47 ~ 60) is first group, and consumer process group (process 61 ~ 99) is second group.
Continuation is with reference to STEP6 ' among the figure 7, and the process (that is: process 2) of choosing the logical process minimum in consumer process group (process 2 ~ 30) is the level-2 area host process, and remaining process is (process 3 ~ 30) common process.The process (that is: process 31) of choosing the logical process minimum in consumer process group (process 31 ~ 45) is the level-2 area host process, and remaining process is (process 32 ~ 45) common process.The process (that is: process 47) of choosing the logical process minimum in consumer process group (process 46 ~ 60) is the level-2 area host process, and remaining process is (process 48 ~ 60) common process.The process (that is: process 61) of choosing the logical process minimum in consumer process group (process 61 ~ 99) is the level-2 area host process, and remaining process is (process 62 ~ 99) common process.
So far, all consumer process classifications are complete, formed 4 grades of consumer process that comprise 1 overall host process, 2 level-1 area host processes, 4 level-2 area host processes and other 93 common processes.
Need to prove, above embodiment is intended to illustrate the step of consumer process classification of the present invention, and the process number of employing and regional host process progression are less, should not be construed as the restriction to number of processes of the present invention and minute number of stages.In fact, under the large-scale parallel environment, a calculating problem is comprised of numerous sub-tasks, and its process number can be ten hundreds of.And to the progression of regional host process, can weigh allocative efficiency and storage space, administration overhead and finally determine by operating personnel as aforementioned.
Fig. 8 is the process flow diagram of the 5th embodiment of parallel task dynamic allocation method of the present invention.Different from the 4th embodiment is that this embodiment before formation multi-stage user process, also comprises initialized step with the consumer process classification.As described in Figure 8, this embodiment may further comprise the steps:
Execution in step S501 carries out initialization.Particularly, described initialization comprises: record breakpoint filename, record general assignment number, logger task block size.Further, described task block size is the once task quantity of asking of common process.The product that the once task quantity of asking of described regional host process is a task block size and all consumer process numbers of its subordinate.
Execution in step S502, with all consumer process according to overall host process, level-1 area host process and common process are divided into the multi-stage user process at least.
Execution in step S503, the parallel task ordering that host process is to be allocated with the corresponding levels forms task queue to be allocated at the corresponding levels.
Need to prove, in the parallel task ordering that the corresponding levels are to be allocated of described host process, form before the task queue to be allocated at the corresponding levels, also comprise: for each task is distributed unique task number; Described allocating task comprises: the task number that provides institute's allocating task.After the task queue to be allocated that forms overall host process, also comprise: after the task queue to be allocated of overall host process, increase by an end mark; When the task number that receives was described end mark, parallel task assigned.Such as: be each task allocating task number continuously from natural number 1 beginning, that is: the task number of first task is 1 ..., the task number of n task is n.Task queue to be allocated (namely having comprised all tasks to be allocated) in overall host process increases by an end mark afterwards, and this end mark is-2.Then when consumer process is assigned to task number for-2 task, show that namely all tasks assign.
Continuation can select to be implemented as next stage consumer process allocating task with reference to figure 8, perhaps is the host process allocating task.If next stage consumer process allocating task, then execution in step S504 receives the task requests message of next stage consumer process transmission and the task quantity of asking.Execution in step S505 judges that whether the task quantity of asking is greater than the task quantity in the corresponding levels task queue to be allocated.If the task quantity of asking is greater than the task quantity in the corresponding levels task queue to be allocated, execution in step S506 then, the task quantity that sends task requests message and ask to the upper level consumer process, after the task of receiving the distribution of upper level consumer process, upgrade the task queue to be allocated of the described corresponding levels, then return step S505 and continue to carry out.If the task quantity of asking is less than or equal to the task quantity in the task queue to be allocated at the corresponding levels, execution in step S507 then, from the head of the queue of corresponding levels task queue to be allocated, the task quantity according to the next stage consumer process is asked is next stage consumer process allocating task.Execution in step S508 upgrades task queue to be allocated at the corresponding levels.
If the host process allocating task, execution in step S509 then suspends and is next stage consumer process allocating task.Execution in step S510 from the head of the queue of corresponding levels task queue to be allocated, according to the processing power of host process, is the allocating task of host process own.Execution in step S511 upgrades task queue to be allocated at the corresponding levels.Execution in step S512 reverts to next stage consumer process allocating task.
Execution in step S513, judge in consumer process reception and the process of executing the task whether break down, if fault has occured, execution in step S514 then, breaking down of task is flow back to receipts, and arrive the tail of the queue of the task queue to be allocated of the consumer process management that distributes this task, distribute with again participation task, return step S504 or step S509, continue allocating task.If do not break down, then execution in step S515 judges whether all tasks all distribute complete.If then finish.Otherwise, return step S504 or step S509, continue allocating task.
Below in conjunction with the drawings and specific embodiments technical scheme of the present invention is described further.
Fig. 9 is each stage schematic diagram of the first embodiment of parallel task dynamic allocation method of the present invention.Among this embodiment, a task (task number is 0 ~ 999) that has 1000 non-correlations need to be distributed to 100 processes (logical process number be 0 ~ 99) executed in parallel.These 100 processes are divided into 3 grades, that is: be overall host process by process 0, and process 1 and process 46 are regional host process, and process 2 ~ process 45, process 47 ~ process 99 are common process.Wherein, overall host process (process 0) and regional host process (process 1, process 46) possess the task distribution capability.
With reference to STEP101 among the figure 9, overall host process (process 0) sorts 1000 tasks from small to large according to task number, forms the task queue to be allocated of overall host process.And the most end in this formation has increased end mark (numerical value is-2).
Continuation is with reference to STEP102 among the figure 9, and common process (process 2) sends task requests to the consumer process (that is: regional host process-process 1) of its upper level, and the task queue at the corresponding levels to be allocated of process 1 is empty at this moment.Therefore, process 1 continuation is to consumer process (that is: the overall host process-process 0) request task of its upper level.Overall situation host process-process 0 has been distributed front 100 tasks (that is: task number is 0 ~ 99 task) of task queue to be allocated at the corresponding levels to regional host process-process 1, and the task queue at the corresponding levels to be allocated of having upgraded overall host process is 900 tasks of task number 100 ~ 999.
Equally, also to be assigned to overall host process-process 0 be 100 tasks of 100 ~ 199 to the task number of its distribution to another regional host process-process 46.Simultaneously, the task queue at the corresponding levels to be allocated of overall host process is updated to 800 tasks of task number 200 ~ 999.
Continuation is with reference to STEP103 among the figure 9, and overall host process-process 0 has also been distributed task number for self be 200 task, and the simultaneously task queue at the corresponding levels to be allocated of overall host process is updated to the task of task number 201 ~ 999.
Existing enough task dividables are joined in the task sequence to be allocated of this time domain host process, and therefore to have distributed task number for common process-process 2 ~ process 45 of its next stage be 0 ~ 43 task to regional host process-process 1.For cheer and bright, each consumer process is once in the present embodiment only asks 1 task, therefore to be assigned to task number be 0 task to common process-process 2, it is 1 task that common process-process 3 has been assigned to task number, ..., it is 43 task that common process-process 45 has been assigned to task number.The task queue at the corresponding levels to be allocated of zone host process-process 1 is updated to task number 44 ~ 99 tasks.Simultaneously, regional host process-process 1 itself also is assigned to 1 task (task number is 44), and the task queue at the corresponding levels to be allocated of having upgraded regional host process-process 1 is the task of task number 45 ~ 99.
Another regional host process-process 46 also begins domestic consumer's process-process 47 ~ 99 allocating tasks toward its next stage, also is regional host process-process 46 allocating tasks own simultaneously.From the STEP103 of Fig. 9, we can find out, regional host process-process 46 and under the common process speed of executing the task, the task in regional host process-process 46 task queues to be allocated assigns, be sky this moment.If common process-process 47 ~ 99 is again to regional host process-process 46 request tasks, then regional host process-process 46 need to behind overall host process-process 0 request task of its upper level, could down continue to distribute.
Continuation continues above-mentioned dynamic task allocation with reference to the STEP10X of figure 9, is the task of end mark (that is :-2) until there is a consumer process to receive task number, shows that all tasks assign.
Figure 10 is each stage schematic diagram of the second embodiment of parallel task dynamic allocation method of the present invention.Different from the first embodiment is that the consumer process in the present embodiment is 4 grades.
In the present embodiment, there is too the task (task number is 0 ~ 999) of 1000 non-correlations need to distribute to 100 processes (logical process number be 0 ~ 99) executed in parallel.These 100 processes are divided into 4 grades, that is: the first order is overall host process-process 0, the second level is level-1 area host process-process 1 and process 46, the third level is level-2 area host process-process 2, process 31, process 47 and process 61, and the fourth stage is 93 remaining common process-processes 3 ~ 30, process 32 ~ 45, process 48 ~ 60 and processes 62 ~ 99.Wherein, overall host process (process 0), level-1 area host process (process 1, process 46), level-2 area host process (process 2, process 31, process 47 and process 61) possess the task distribution capability.
With reference to STEP201 among Figure 10, overall host process (process 0) sorts 1000 tasks from small to large according to task number, forms the task queue to be allocated of overall host process.And the most end in this formation has increased end mark (numerical value is-2).
Continuation is with reference to STEP202 among Figure 10, and common process (process 3) sends task requests to the consumer process (that is: level-2 area host process-process 2) of its upper level.But this moment, the task queue at the corresponding levels to be allocated of process 2 was empty, joined without task dividable.Therefore, process 2 continuation are to consumer process (that is: the level-1 area host process-process 1) request task of its upper level.But this moment, the task queue at the corresponding levels to be allocated of process 1 also was empty, joined without task dividable.Therefore, process 1 continuation is to consumer process (that is: the overall host process-process 0) request task of its upper level.
Overall situation host process-process 0 has been distributed front 100 tasks (that is: task number is 0 ~ 99 task) in the task queue to be allocated at the corresponding levels to regional host process-process 1, and the task queue at the corresponding levels to be allocated of having upgraded overall host process is 900 tasks of task number 100 ~ 999.
Equally, according to the task requests of another level-1 area host process-process 46, overall host process-process 0 has been distributed front 100 tasks in the task queue to be allocated at the corresponding levels (that is: task number is 100 ~ 199 1 task) to it.Simultaneously, the task queue at the corresponding levels to be allocated of overall host process is updated to 800 tasks of task number 200 ~ 999.
Continuation is with reference to STEP203 among Figure 10, and overall host process-process 0 has also been distributed task number for self be 200 task, and the simultaneously task queue at the corresponding levels to be allocated of overall host process is updated to the task of task number 201 ~ 999.
Existing enough task dividables are joined in the task sequence to be allocated of level-1 area host process at this moment, therefore distributed first task number for self be 0 task to level-1 area host process-process 1, and the task queue to be allocated of having upgraded level-1 area host process-process 1 is the task of task number 1 ~ 99.
Then, level-1 area host process-process 1 has been distributed front 30 tasks (that is: task number is 1 ~ 30 task) in its task sequence to be allocated for the level-2 area host process-process 2 of its next stage, and the task queue to be allocated of having upgraded simultaneously level-1 area host process-process 1 is the task of task number 31 ~ 99.
Level-1 area host process-process 1 has also been distributed 30 tasks (that is: task number is 31 ~ 60 task) for another level-2 area host process-process 31 of its next stage, and the task queue to be allocated of having upgraded simultaneously level-1 area host process-process 1 is the task of task number 61 ~ 99.
Simultaneously, another level-1 area host process-process 46 also begins the level-2 area host process allocating task for its next stage.
Level-1 area host process-process 46 has been distributed first task number for self be 100 task, and the task queue to be allocated of having upgraded level-1 area host process-process 46 is the task of task number 101 ~ 99.
Then, it is 101 ~ 120 task that level-1 area host process-process 46 has been distributed task number for level-2 area host process-process 47, and the task queue to be allocated of having upgraded simultaneously level-1 area host process-process 46 is the task of task number 121 ~ 199.
It is 121 ~ 170 task that level-1 area host process-process 46 has also been distributed task number for another level-2 area host process-process 61 of its next stage, and the task queue to be allocated of having upgraded simultaneously level-1 area host process-process 46 is the task of task number 171 ~ 199.
Continuation is with reference to the STEP204 among Figure 10, and level-2 area host process-process 2 is common process-process 3 ~ process 30 allocating tasks of its next stage.Common process-process 3 has been assigned to task number is 1 task, it is 2 task that common process-process 4 has been assigned to task number ..., it is 28 task that common process-process 30 has been assigned to task number.The task queue at the corresponding levels to be allocated of level-2 area host process-process 2 is updated to task number 29 ~ 30 tasks.
Simultaneously, level-2 area host process-process 2 has also been distributed task number for himself be 29 task, so only to be left task number in its task queue to be allocated at the corresponding levels be a task of 30.
Another level-2 area host process-process 31 also begins domestic consumer's process-process 32 ~ 45 allocating tasks toward its next stage.Common process-process 32 has been assigned to task number is 31 task, it is 32 task that common process-process 33 has been assigned to task number ..., it is 44 task that common process-process 45 has been assigned to task number.The task queue at the corresponding levels to be allocated of level-2 area host process-process 31 is updated to the task of task number 45 ~ 60.
Simultaneously, level-2 area host process-process 31 has also been distributed task number for himself be 45 task, so its task queue to be allocated at the corresponding levels is updated to the task of task number 46 ~ 60.
Another level-2 area host process-process 47 also begins domestic consumer's process-process 48 ~ 60 allocating tasks toward its next stage.Common process-process 48 has been assigned to task number is 101 task, it is 102 task that common process-process 49 has been assigned to task number ..., it is 113 task that common process-process 60 has been assigned to task number.The task queue at the corresponding levels to be allocated of level-2 area host process-process 47 is updated to the task of task number 114 ~ 120.
Simultaneously, level-2 area host process-process 47 has also been distributed task number for himself be 114 task, so its task queue to be allocated at the corresponding levels is updated to task number 115 ~ 120 tasks.
Another level-2 area host process-process 61 also begins domestic consumer's process-process 62 ~ 99 allocating tasks toward its next stage.Common process-process 62 has been assigned to task number is 121 task, it is 122 task that common process-process 63 has been assigned to task number ..., it is 158 task that common process-process 99 has been assigned to task number.The task queue at the corresponding levels to be allocated of level-2 area host process-process 61 is updated to the task of task number 159 ~ 170.
Simultaneously, level-2 area host process-process 61 has also been distributed task number for himself be 159 task, so its task queue to be allocated at the corresponding levels is updated to task number 160 ~ 170 tasks.
So far, each consumer process has been assigned to task.Afterwards, after task is finished, continuing reciprocal above-mentioned dynamic task allocation, is the task of end mark (that is :-2) until there is a consumer process to receive task number, and then all tasks assign, do not repeat them here.
Figure 11 is each stage schematic diagram of the 3rd embodiment of parallel task dynamic allocation method of the present invention; Specifically illustrated fault-tolerant process in the present embodiment.
The present embodiment adopts the same consumer process classification of the first embodiment, that is: a task (task number is 0 ~ 999) that has 1000 non-correlations need to be distributed to 100 processes (logical process number be 0 ~ 99) executed in parallel.These 100 processes are divided into 3 grades, that is: process 0 is overall host process, and process 1 and process 46 are regional host process, and process 2 ~ process 45, process 47 ~ process 99 are common process.Wherein, overall host process (process 0) and regional host process (process 1, process 46) possess the task distribution capability.
With reference to STEP301 among Figure 11, overall situation host process has been that 0 ~ 99 task has been given regional host process-process 1 with task number, be that 100 ~ 199 task has been given regional host process-process 46 with task number, be that 200 task has been given self with task number, therefore the task queue to be allocated of overall host process-process 0 is the task of task number 201 ~ 999.
Zone host process-process 1 is that 0 task has been distributed to common process-process 2 with task number, ..., be that 43 task has been distributed to common process-process 45 with task number, be that 44 task has been distributed to self with task number, therefore the task queue to be allocated of interval host process-process 1 is the task of task number 45 ~ 99.
Zone host process-process 46 is also to the common course allocation task of its next stage.Zone host process-process 46 and lower common process thereof the speed of executing the task, the task in regional host process-process 46 task queues to be allocated assigns, and be sky this moment.Zone host process-process 46 is from the task of in the number of executing the task being 100, and common process-process 47 is 131 task in the number of executing the task ..., common process-process 99 is 199 task in the number of executing the task.
At this moment, find that common process-process 45 when the number of executing the task is 43 task, fault occurred.
Continuation is with reference to the STEP302 of Figure 11, and it is 43 task that regional host process-process 1 has been regained the task number of distributing to fault resource-process 45, it is added to the tail of the queue of the task queue to be allocated of regional host process-process 1, from newly participating in the distribution.Before process 45 restarted, regional host process-process 1 can not be its allocating task.At present, always have 99 consumer process and continue to finish remaining parallel task.
Continuation is with reference to the STEP303 of Figure 11, and find that fault has also occured regional host process-process 1 this moment.
Continuation is with reference to the STEP304 of Figure 11, overall situation host process-process 0 has been regained the still uncompleted task (that is: task number is 0 ~ 99 task) of distributing to regional host process-process 1, be added to the tail of the queue of the task queue to be allocated of overall host process-process 0, from newly participating in the distribution.Before process 1 restarted, overall host process-process 0 can not be its allocating task.At present, always have 98 consumer process and continue to finish remaining parallel task.
Simultaneously, in the common process of the next stage of former regional host process-process 1, choose process 2 and serve as new regional host process.Overall situation host process-process 0 can according to the task requests of new regional host process-process 2, be its allocating task.
Figure 12 is each stage schematic diagram of the 4th embodiment of parallel task dynamic allocation method of the present invention; Different from the first embodiment is that the present embodiment forms before the task queue to be allocated at the corresponding levels in the described consumer process parallel task ordering that the corresponding levels are to be allocated that possesses the task distribution capability, has also comprised the step with all user's classifications.Specifically with reference to the STEP401 of Figure 12, in the present embodiment, a task (task number is 0 ~ 999) that has 1000 non-correlations need to be distributed to 100 processes (logical process number be 0 ~ 99) executed in parallel.
Continuation is with reference to the STEP402 of Figure 12,100 consumer process of logical process number 0 ~ 99 are divided into 3 grades: the first order is 1 overall host process (process 0), the second level is 2 regional host processes (process 1, processes 46), the 3rd 97 common processes (process 2 ~ process 45, process 47 ~ process 99) very.Specifically be divided into multistage method and be explained in the aforementioned embodiment, repeat no more herein.
Each step of other of the present embodiment is basically identical with the first embodiment shown in Figure 9, can with reference to the first embodiment, repeat no more herein.
Figure 13 is each stage schematic diagram of the 5th embodiment of parallel task dynamic allocation method of the present invention.The present embodiment has specifically illustrated the process of record breakpoint file.The present embodiment adopts the same consumer process classification of the first embodiment, that is: a task (task number is 0 ~ 999) that has 1000 non-correlations need to be distributed to 100 processes (logical process number be 0 ~ 99) executed in parallel.These 100 processes are divided into 3 grades, that is: process 0 is overall host process, and process 1 and process 46 are regional host process, and process 2 ~ process 45, process 47 ~ process 99 are common process.Wherein, overall host process (process 0) and regional host process (process 1, process 46) possess the task distribution capability.
With reference to STEP501 among Figure 13, overall situation host process has been that 0 ~ 99 task has been given regional host process-process 1 with task number, be that 100 ~ 199 task has been given regional host process-process 46 with task number, be that 200 task has been given self with task number, therefore the task queue to be allocated of overall host process-process 0 is the task of task number 201 ~ 999.
Zone host process-process 1 is that 0 task has been distributed to common process-process 2 with task number, ..., be that 43 task has been distributed to common process-process 45 with task number, be that 44 task has been distributed to self with task number, therefore the task queue to be allocated of interval host process-process 1 is the task of task number 45 ~ 99.
Zone host process-process 46 is that 101 task has been distributed to common process-process 47 with task number, ..., be that 153 task has been distributed to common process-process 99 with task number, be that 100 task has been distributed to self with task number, therefore the task queue to be allocated of interval host process-process 46 is the task of task number 154 ~ 199.
Because the task that also do not finish this moment, so the breakpoint file is empty.
Continuation is with reference to the STEP502 of Figure 13, and overall host process-process 0 has been finished 10 tasks (task number is 200 ~ 209) successively, is 210 task in the number of executing the task.Therefore, be that 10 task records of 200 ~ 209 are in the breakpoint file with completed task number.
Continuation is with reference to the STEP503 of Figure 13, and regional host process-process 46 has been finished to 100 tasks (task number is 100 ~ 199) of overall host process-process 0 request.Therefore, be that 100 task records of 100 ~ 199 are in the breakpoint file with completed task number.
Overall situation host process-process 0 has been distributed 90 tasks (task number is 211 ~ 299) to regional host process-process 46 again, and the task queue to be allocated of overall host process-process 0 is that task number is 300 ~ 999 task.
Zone host process-process 46 has been distributed task number for self be 211 task, having distributed task number for the common process-process 47 ~ 99 of its next stage is 212 ~ 264 task, and the task queue to be allocated of regional host process-process 46 is that task number is 265 ~ 299 task.
If before all tasks all are finished, fault has occured in overall host process-process 0, then can read the breakpoint file of nearest record, to return to nearest checkpoint, continues to distribute and carry out Unrecorded not yet being finished of task in the breakpoint file.
Figure 14 is each stage schematic diagram of the 6th embodiment of parallel task dynamic allocation method of the present invention.Different from the 5th embodiment is that the described consumer process parallel task ordering that the corresponding levels are to be allocated that possesses the task distribution capability of the present embodiment forms before the task queue to be allocated at the corresponding levels, has also comprised: carry out initialization, with the step of all user's classifications.
With reference to the STEP601 of Figure 14, described initialization comprises: record breakpoint file File by name, record general assignment number is 1000, and the logger task block size is 1.
Continuation is with reference to the STEP602 of Figure 14, and the task of 1000 non-correlations in the present embodiment (task number is 0 ~ 999) need to be distributed to 100 processes (logical process number be 0 ~ 99) executed in parallel.
Continuation is with reference to the STEP603 of Figure 14,100 consumer process of logical process number 0 ~ 99 are divided into 3 grades: the first order is 1 overall host process (process 0), the second level is 2 regional host processes (process 1, processes 46), the 3rd 97 common processes (process 2 ~ process 45, process 47 ~ process 99) very.Specifically be divided into multistage method and be explained in the aforementioned embodiment, repeat no more herein.At this moment, because also not finishing of task, so breakpoint file File is empty.
Other steps of the present embodiment and the 5th embodiment shown in Figure 13 are basically identical, can with reference to the 5th embodiment, repeat no more herein.
Need to prove, through the above description of the embodiments, those skilled in the art can be well understood to partly or entirely can realizing by software and in conjunction with essential general hardware platform of the application.Based on such understanding, the part that the application's technical scheme contributes to prior art in essence in other words can embody with the form of software product, this computer software product can comprise the one or more machine readable medias that store machine-executable instruction on it, and these instructions are can be so that these one or more machines come executable operations according to embodiments of the invention when carrying out such as the one or more machines such as computing machine, computer network or other electronic equipments.Machine readable media can comprise, but be not limited to floppy disk, CD, CD-ROM(compact-disc-ROM (read-only memory)), magneto-optic disk, ROM(ROM (read-only memory)), the RAM(random access memory), the EPROM(Erasable Programmable Read Only Memory EPROM), the EEPROM(Electrically Erasable Read Only Memory), magnetic or optical card, flash memory or be suitable for store the medium/machine readable media of the other types of machine-executable instruction.
The application can be used in numerous general or special purpose computingasystem environment or the configuration.Such as: personal computer, server computer, handheld device or portable set, plate equipment, multicomputer system, based on microprocessor system, set top box, programmable consumer-elcetronics devices, network PC, small-size computer, mainframe computer, comprise the distributed computing environment of above any system or equipment etc.
The application can describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract data type, program, object, assembly, data structure etc.Also can in distributed computing environment, put into practice the application, in these distributed computing environment, be executed the task by the teleprocessing equipment that is connected by communication network.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
The present invention is by the multilayer dynamic task allocation pattern based on queue theory model, with the dynamic task allocation service distribution to a plurality of computational resources, reduced the cost of dynamic task allocation, Effective Raise the efficient of task distribution services, thereby avoided the generation of service hot spot, reached the load balance between numerous computational resources.
The present invention is also by dividing into groups to form tree-like arranging to consumer process, more to simplify higher level's consumer process to subordinate's consumer process and to the management of task.
The present invention is the situation by distributing in service end record current task also, in the situation that the part computational resource breaks down, the task of distributing to the fault resource is reclaimed, reassign to healthy computational resource, to guarantee that concurrent application can continue correct execution, fault-tolerant efficient is provided, and the impact that simultaneously the fault resource is brought is confined to certain scope.In addition, the loss that brings of the effective Reduction of failure resource of upgrading in time also of breakpoint file.
Although the present invention with preferred embodiment openly as above; but it is not to limit the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; can utilize method and the technology contents of above-mentioned announcement that technical solution of the present invention is made possible change and modification; therefore; every content that does not break away from technical solution of the present invention; to any simple modification, equivalent variations and modification that above embodiment does, all belong to the protection domain of technical solution of the present invention according to technical spirit of the present invention.
Claims (15)
1. a parallel task dynamic allocation method is characterized in that, the method is applicable to comprise the parallel system of multi-stage user process; Described multi-stage user process comprises at least two-stage host process and common process; The method comprises:
The parallel task ordering that described host process is to be allocated with the corresponding levels forms task queue to be allocated at the corresponding levels;
Described host process receives the task requests message of next stage consumer process transmission and the task quantity of asking;
Described host process is from the head of the queue of corresponding levels task queue to be allocated, and the task quantity according to the next stage consumer process is asked is next stage consumer process allocating task, and upgrades task queue to be allocated at the corresponding levels.
2. parallel task dynamic allocation method as claimed in claim 1 is characterized in that, the method also comprises:
Described host process according to the processing power of described host process itself, is the host process allocating task from the head of the queue of corresponding levels task queue to be allocated, and upgrades task queue to be allocated at the corresponding levels; In the process that is the host process allocating task, suspend and be next stage consumer process allocating task.
3. any parallel task dynamic allocation method as claimed in claim 1 or 2 is characterized in that, also comprises:
If the task quantity of asking is greater than the task quantity in the task queue to be allocated of the described corresponding levels, the described host process task quantity that sends task requests message and ask to its upper level consumer process is then upgraded the task queue to be allocated of the described corresponding levels after receiving the task that the upper level consumer process distributes.
4. parallel task dynamic allocation method as claimed in claim 3 is characterized in that, the method also comprises:
If described consumer process receive and the process of executing the task in break down, then breaking down of task is reclaimed, and is discharged to the tail of the queue of the task queue to be allocated that the consumer process that distributes this task manages, distribute with again participation task.
5. parallel task dynamic allocation method as claimed in claim 4 is characterized in that, described host process comprises overall host process and regional host process;
Described multi-stage user process comprises overall host process, at least level-1 area host process and common process;
Described overall host process, level-1 area host process and common process are tree-shaped and arrange at least; Wherein, overall host process is root node; The zone host process is branch node; Common process is leafy node.
6. parallel task dynamic allocation method as claimed in claim 5 is characterized in that, in the parallel task ordering that the corresponding levels are to be allocated of described host process, forms before the task queue to be allocated at the corresponding levels, also comprises:
With all consumer process according to overall host process, level-1 area host process and common process are divided into the multi-stage user process at least.
7. parallel task dynamic allocation method as claimed in claim 6 is characterized in that, described with all consumer process according to overall host process, level-1 area host process and common process are divided into the multi-stage user process and comprise at least:
Choose the consumer process as overall host process;
With other consumer process groupings; In each group, choose the consumer process as regional host process;
Remaining consumer process is common process.
8. parallel task dynamic allocation method as claimed in claim 7 is characterized in that, described the grouping of other consumer process is comprised:
Consumer process except overall host process is divided into groups to form the level-1 area host process;
Perhaps the consumer process except overall host process is divided into groups to form the level-1 area host process, and in the consumer process group that grouping forms afterwards, divide into groups step by step again, to be formed with the up and down multistage regional host process of subordinate relation.
9. parallel task dynamic allocation method as claimed in claim 8 is characterized in that,
The described consumer process of choosing as overall host process comprises that the consumer process of choosing the logical process minimum is overall host process;
The described consumer process of in each group, choosing as regional host process comprise select logical process minimum in each group consumer process be regional host process.
10. parallel task dynamic allocation method as claimed in claim 5 is characterized in that, the method also comprises:
Described overall host process records the distribution condition of all tasks, and the task performance of returning according to the consumer process that receives task, record breakpoint file;
Described regional host process records the distribution condition of task to be allocated at the corresponding levels, and according to the task performance that the consumer process that receives task returns, returns task performance at the corresponding levels to its upper level consumer process;
Described common process is returned the task performance of common process itself to its upper level consumer process.
11. parallel task dynamic allocation method as claimed in claim 10 is characterized in that, the method also comprises:
If described common process breaks down, the task of then will distribute to this common process reclaims, and is discharged to the tail of the queue of task queue to be allocated of the regional host process management of its upper level, and again participation task is distributed;
If described regional host process breaks down, the task of then will distribute to this zone host process reclaims, and is discharged to the tail of the queue of task queue to be allocated of the consumer process management of its upper level, and again participation task is distributed; And from the consumer process of this zone host process next stage, select new regional host process, continue as next stage consumer process allocating task;
When described overall host process breaks down, from the regional host process of its next stage, select new overall host process, read described breakpoint file, continue to distribute Unrecorded not the finishing the work of described breakpoint file.
12. parallel task dynamic allocation method as claimed in claim 10 is characterized in that, in the parallel task ordering that the corresponding levels are to be allocated of described host process, forms before the task queue to be allocated at the corresponding levels, also comprises:
Carry out initialization; Described initialization comprises: record breakpoint filename, record general assignment number, logger task block size.
13. parallel task dynamic allocation method as claimed in claim 12 is characterized in that,
The once task quantity of asking of described common process is a task block size;
The product that the once task quantity of asking of described regional host process is a task block size and all consumer process numbers of its subordinate.
14. parallel task dynamic allocation method as claimed in claim 12 is characterized in that, in the parallel task ordering that the corresponding levels are to be allocated of described host process, forms before the task queue to be allocated at the corresponding levels, also comprises: for each task is distributed unique task number;
Described allocating task comprises: the task number that provides institute's allocating task.
15. parallel task dynamic allocation method as claimed in claim 14 is characterized in that, also comprises:
After the task queue to be allocated of overall host process, increase by an end mark;
When the task number that receives was described end mark, parallel task assigned.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210438264.6A CN102929707B (en) | 2012-11-06 | 2012-11-06 | Parallel task dynamical allocation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210438264.6A CN102929707B (en) | 2012-11-06 | 2012-11-06 | Parallel task dynamical allocation method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102929707A true CN102929707A (en) | 2013-02-13 |
CN102929707B CN102929707B (en) | 2015-10-07 |
Family
ID=47644515
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210438264.6A Active CN102929707B (en) | 2012-11-06 | 2012-11-06 | Parallel task dynamical allocation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102929707B (en) |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104793992A (en) * | 2015-04-21 | 2015-07-22 | 浙江大学 | Parallel task processing method based on task decomposition |
CN104932936A (en) * | 2015-06-05 | 2015-09-23 | 北京奇虎科技有限公司 | Data processing method and system |
CN105471595A (en) * | 2014-06-09 | 2016-04-06 | 株式会社日立制作所 | Fault processing management device and fault processing management method |
CN105573850A (en) * | 2015-11-09 | 2016-05-11 | 广州多益网络科技有限公司 | Multi-process interactive method and system and server |
CN105607956A (en) * | 2016-01-06 | 2016-05-25 | 北京京东尚科信息技术有限公司 | Task allocation method and system in computer |
CN106055401A (en) * | 2016-06-13 | 2016-10-26 | 北京唯智佳辰科技发展有限责任公司 | Automatic starting-stopping and computation task dynamic allocation method for mass parallel coarse particle computation |
CN107133086A (en) * | 2016-02-29 | 2017-09-05 | 阿里巴巴集团控股有限公司 | Task processing method, device and system based on distributed system |
CN107992356A (en) * | 2017-12-13 | 2018-05-04 | 上海壹账通金融科技有限公司 | Block chain affairs block processes method, electronic device and readable storage medium storing program for executing |
CN108197808A (en) * | 2017-12-29 | 2018-06-22 | 广东溢达纺织有限公司 | Production task distribution method, device and system |
CN108198027A (en) * | 2017-12-29 | 2018-06-22 | 珠海国芯云科技有限公司 | Supermarket's intelligent queuing clearing sequential scheduling method and device based on Internet of Things |
CN108241534A (en) * | 2016-12-27 | 2018-07-03 | 阿里巴巴集团控股有限公司 | A kind of task processing, distribution, management, the method calculated and device |
CN108900631A (en) * | 2018-07-27 | 2018-11-27 | 阿里巴巴集团控股有限公司 | A kind of message distribution method, device and distributed system |
CN108984297A (en) * | 2018-06-28 | 2018-12-11 | 中国建设银行股份有限公司 | Task executing method and device |
CN110990165A (en) * | 2019-11-15 | 2020-04-10 | 北京连山科技股份有限公司 | Method for simultaneously working multiple users in multi-channel concurrent transmission system and transmission server |
CN111583003A (en) * | 2020-05-08 | 2020-08-25 | 国网吉林省电力有限公司 | Massive financial processing transaction parallel execution method in capital centralized control process |
CN113448719A (en) * | 2020-03-27 | 2021-09-28 | 北京沃东天骏信息技术有限公司 | Distributed task processing system |
CN115118768A (en) * | 2022-06-27 | 2022-09-27 | 平安壹钱包电子商务有限公司 | Task distribution method and device, storage medium and electronic equipment |
CN117851076A (en) * | 2024-03-08 | 2024-04-09 | 中国电子信息产业集团有限公司第六研究所 | Scheduling method and device of hardware resources, electronic equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101069161A (en) * | 2004-12-01 | 2007-11-07 | 索尼计算机娱乐公司 | Scheduling method, scheduling device, and multiprocessor system |
US20100153963A1 (en) * | 2008-12-12 | 2010-06-17 | Subbarao Kakarlamudi | Workload management in a parallel database system |
CN101887367A (en) * | 2010-06-22 | 2010-11-17 | 天津大学 | Multi-level parallel programming method |
-
2012
- 2012-11-06 CN CN201210438264.6A patent/CN102929707B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101069161A (en) * | 2004-12-01 | 2007-11-07 | 索尼计算机娱乐公司 | Scheduling method, scheduling device, and multiprocessor system |
US20100153963A1 (en) * | 2008-12-12 | 2010-06-17 | Subbarao Kakarlamudi | Workload management in a parallel database system |
CN101887367A (en) * | 2010-06-22 | 2010-11-17 | 天津大学 | Multi-level parallel programming method |
Cited By (32)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105471595A (en) * | 2014-06-09 | 2016-04-06 | 株式会社日立制作所 | Fault processing management device and fault processing management method |
CN104793992B (en) * | 2015-04-21 | 2018-05-01 | 浙江大学 | The parallel task processing method that a kind of task based access control decomposes |
CN104793992A (en) * | 2015-04-21 | 2015-07-22 | 浙江大学 | Parallel task processing method based on task decomposition |
CN104932936A (en) * | 2015-06-05 | 2015-09-23 | 北京奇虎科技有限公司 | Data processing method and system |
CN105573850A (en) * | 2015-11-09 | 2016-05-11 | 广州多益网络科技有限公司 | Multi-process interactive method and system and server |
CN105607956B (en) * | 2016-01-06 | 2019-06-04 | 北京京东尚科信息技术有限公司 | Method for allocating tasks and system in a kind of computer |
CN105607956A (en) * | 2016-01-06 | 2016-05-25 | 北京京东尚科信息技术有限公司 | Task allocation method and system in computer |
WO2017148268A1 (en) * | 2016-02-29 | 2017-09-08 | 阿里巴巴集团控股有限公司 | Task processing method, apparatus and system based on distributed system |
US11256539B2 (en) | 2016-02-29 | 2022-02-22 | Alibaba Group Holding Limited | Task processing method, apparatus, and system based on distributed system |
CN107133086B (en) * | 2016-02-29 | 2020-09-04 | 阿里巴巴集团控股有限公司 | Task processing method, device and system based on distributed system |
CN107133086A (en) * | 2016-02-29 | 2017-09-05 | 阿里巴巴集团控股有限公司 | Task processing method, device and system based on distributed system |
CN106055401B (en) * | 2016-06-13 | 2019-02-26 | 北京唯智佳辰科技发展有限责任公司 | Magnanimity calculates the parallel automatic start-stop and calculating task dynamic allocation method of coarse granule |
CN106055401A (en) * | 2016-06-13 | 2016-10-26 | 北京唯智佳辰科技发展有限责任公司 | Automatic starting-stopping and computation task dynamic allocation method for mass parallel coarse particle computation |
CN108241534A (en) * | 2016-12-27 | 2018-07-03 | 阿里巴巴集团控股有限公司 | A kind of task processing, distribution, management, the method calculated and device |
CN107992356B (en) * | 2017-12-13 | 2021-09-14 | 深圳壹账通智能科技有限公司 | Block chain transaction block processing method, electronic device and readable storage medium |
CN107992356A (en) * | 2017-12-13 | 2018-05-04 | 上海壹账通金融科技有限公司 | Block chain affairs block processes method, electronic device and readable storage medium storing program for executing |
CN108197808B (en) * | 2017-12-29 | 2023-10-20 | 广东溢达纺织有限公司 | Production task distribution method, device and system |
CN108198027A (en) * | 2017-12-29 | 2018-06-22 | 珠海国芯云科技有限公司 | Supermarket's intelligent queuing clearing sequential scheduling method and device based on Internet of Things |
CN108197808A (en) * | 2017-12-29 | 2018-06-22 | 广东溢达纺织有限公司 | Production task distribution method, device and system |
CN108984297A (en) * | 2018-06-28 | 2018-12-11 | 中国建设银行股份有限公司 | Task executing method and device |
CN108900631A (en) * | 2018-07-27 | 2018-11-27 | 阿里巴巴集团控股有限公司 | A kind of message distribution method, device and distributed system |
CN108900631B (en) * | 2018-07-27 | 2021-11-16 | 创新先进技术有限公司 | Message distribution method, device and distributed system |
CN110990165A (en) * | 2019-11-15 | 2020-04-10 | 北京连山科技股份有限公司 | Method for simultaneously working multiple users in multi-channel concurrent transmission system and transmission server |
CN110990165B (en) * | 2019-11-15 | 2020-10-09 | 北京连山科技股份有限公司 | Method for simultaneously working multiple users in multi-channel concurrent transmission system and transmission server |
CN113448719A (en) * | 2020-03-27 | 2021-09-28 | 北京沃东天骏信息技术有限公司 | Distributed task processing system |
CN113448719B (en) * | 2020-03-27 | 2024-06-18 | 北京沃东天骏信息技术有限公司 | Distributed task processing system |
CN111583003A (en) * | 2020-05-08 | 2020-08-25 | 国网吉林省电力有限公司 | Massive financial processing transaction parallel execution method in capital centralized control process |
CN111583003B (en) * | 2020-05-08 | 2022-03-29 | 国网吉林省电力有限公司 | Massive financial processing transaction parallel execution method in capital centralized control process |
CN115118768A (en) * | 2022-06-27 | 2022-09-27 | 平安壹钱包电子商务有限公司 | Task distribution method and device, storage medium and electronic equipment |
CN115118768B (en) * | 2022-06-27 | 2024-07-02 | 平安壹钱包电子商务有限公司 | Task distribution method and device, storage medium and electronic equipment |
CN117851076A (en) * | 2024-03-08 | 2024-04-09 | 中国电子信息产业集团有限公司第六研究所 | Scheduling method and device of hardware resources, electronic equipment and storage medium |
CN117851076B (en) * | 2024-03-08 | 2024-05-28 | 中国电子信息产业集团有限公司第六研究所 | Scheduling method and device of hardware resources, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN102929707B (en) | 2015-10-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102929707B (en) | Parallel task dynamical allocation method | |
Polo et al. | Performance-driven task co-scheduling for mapreduce environments | |
Calheiros et al. | Energy-efficient scheduling of urgent bag-of-tasks applications in clouds through DVFS | |
TWI307470B (en) | Dynamic processor redistribution between partitions in a computing system | |
CN103180830B (en) | Central processing unit resource allocation methods and calculating node | |
CN102971724B (en) | The method and apparatus relevant with the management based on modular virtual resource in data center environment | |
KR101502896B1 (en) | Distributed memory cluster control apparatus and method using map reduce | |
CN102193853B (en) | Monitor of virtual machine and its dispatching method | |
US10333859B2 (en) | Multi-tenant resource coordination method | |
CN107864211B (en) | Cluster resource dispatching method and system | |
CN111538586A (en) | Cluster GPU resource management scheduling system, method and computer readable storage medium | |
CN109992422A (en) | A kind of method for scheduling task towards GPU resource, device and system | |
CN110162388A (en) | A kind of method for scheduling task, system and terminal device | |
CN112269641A (en) | Scheduling method, scheduling device, electronic equipment and storage medium | |
CN114356543A (en) | Kubernetes-based multi-tenant machine learning task resource scheduling method | |
JP2021056955A (en) | Distributed storage system and data migration method | |
JP5672386B2 (en) | Computer and resource search method | |
CN111309440B (en) | Method and equipment for managing and scheduling multiple types of GPUs | |
CN114968566A (en) | Container scheduling method and device under shared GPU cluster | |
Yang et al. | Multi-policy-aware MapReduce resource allocation and scheduling for smart computing cluster | |
CN114996003A (en) | Cloud service deployment method and device, electronic equipment and storage medium | |
Mylavarapu et al. | An optimized capacity planning approach for virtual infrastructure exhibiting stochastic workload | |
CN111796932A (en) | GPU resource scheduling method | |
KR100788328B1 (en) | Middle ware system using grid computing and method therof | |
CN110347502A (en) | Load equilibration scheduling method, device and the electronic equipment of cloud host server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |