• 沒有找到結果。

Processor Allocation Algorithms

Chapter 2.  Related Works

2.2  Processor Allocation Algorithms

In this section, we introduce four types of processor allocation algorithms. The problem here would be how the processors should be allocated to the jobs, to obtain the optimal scheduling length. The algorithms here will be called after the process of the job scheduling algorithms, when there are enough processors for the job to use in the system. Therefore, we can suppose that every job in the job list will receive a scheduled outcome, such as

( (

Pj1,si,1

) (

, Pj2,si,2

) (

,K, Pjm,si,m

) )

, when the jobs pass the processor allocation algorithms.

2.2.1 Naive

This is a simpler and naive algorithm. It thinks like this: resources in the system that can provide their PEs for the job’s demand means they will provide until the job’s demand is satisfied. For example, suppose there are four resources in the Grid environment, where Resource1 has four processors, Resource2 has two processors, Resource3 has sixteen processors, and Resource4 has eight processors; see the Initial in Fig. 2-4. These four resources have not gone through any assignment of order by priority. For instance, when a job requests for two processors, it will directly take away two processors from Resource1.

Therefore, Resource1 is left with two processors; see Step one in Fig. 2-4. If the second job needs eight processors, it will take two processors from Resource1, two processors from Resource2, and four processors from Resource3. Then, Resource3 is left with twelve processors; see Step two of Fig. 2-4. After the dispatching of the two jobs, we only have twelve processors at Resource3 and eight processors at Resource4. See Fig. 2-5 for details of the Naive algorithm.

The advantage of this algorithm is: (1) the process method is simple and not complex.

The disadvantage is: (1) for resources in the system, the optimal scheduling process is not conducted, therefore, wasting of resources or decreasing in the service quality may be occurred.

Initial Resource1 4

Resource2 2 Resource3 16 Resource4 8

Step 1: Job_1

Resource1 4 Resource2 2 Resource3 16 Resource4 8

Resource1 2 Resource2 2 Resource3 16 Resource4 8

Step 2: Job_2

Resource1 2 Resource2 2 Resource3 16 Resource4 8

Resource1 0 Resource2 0 Resource3 12 Resource4 8

If Step 3

Resource1 0 Resource2 0 Resource3 12

Resource4 8

… …

Figure 2-4. Example of Naive Algorithm Job_1 needs 2 PEs

Resource1: 2 Resource2: 0 Resource3: 0 Resource4: 0

Job_2 needs 8 PEs Resource1: 2 Resource2: 2 Resource3: 4 Resource4: 0

Input: s and i

(

2' '

)

Figure 2-5. Algorithm Naive 2.2.2 Largest Machine First (LMF)

We can understand how this algorithm works just by reading Largest Machine First. It thinks like: resources in the Grid system will be sorted in an order according to their processor amount. This distributes according to the processor demand of the job. We continue using the example used in the Naive algorithm section. Suppose there are four resources in the Grid environment, where Resource1 has four processors, Resource2 has two processors, Resource3 has sixteen processors, and Resource4 has eight processors. The resources have to be sorted according to the processor amounts they have, from big to small. The distribution order would become Resource3→Resource4→Resource1→Resource2. When the first job requests two

processors, it will take two processors from Resource3; it is now left with fourteen processors, see Step one in Fig. 2-6. When the second job requests eight processors, the resources will be sorted again according to their processor amount. Now the resource order before the scheduling of the job would be Resource3→Resource4→Resource1→Resource2. Resource3 will allocate eight processors for the second job; Resource3 is now left with six processors, see Step two in Fig. 2-6. When there is a third job request, the resource order before the scheduling of the job would be Resource4→Resource3→Resource1→Resource2; see Step three in Fig. 2-6. Details of LMF algorithm may be seen in Fig. 2-7.

The advantage of this algorithm is: (1) when the job scheduling in the job list uses LJF algorithm, they will decrease the possibility of jobs being split into sub-jobs and the communication cost between sub-jobs. The disadvantage is: (1) when there are many jobs and the job scheduling in the job list uses Smallest Job First (SJF) algorithm, there may be lots of sub-jobs when scheduling proceeds to the larger jobs in the back, this in turn increases the communication cost of sub-jobs.

Initial Resource1 4

Resource2 2 Resource3 16 Resource4 8

Step 1: Job_1

Resource3 16 Resource4 8 Resource1 4 Resource2 2

Resource3 14 Resource4 8 Resource1 4 Resource2 2

Step 2: Job_2

Resource3 14 Resource4 8 Resource1 4 Resource2 2

Resource3 6 Resource4 8 Resource1 4 Resource2 2

If Step 3

Resource4 8 Resource3 6 Resource1 4

Resource2 2

… …

Figure 2-6. Example of LMF Algorithm Job_1 needs 2 PEs

Resource1: 0 Resource2: 0 Resource3: 2 Resource4: 0

Job_2 needs 8 PEs Resource1: 0 Resource2: 0 Resource3: 8 Resource4: 0

Input: s and i

(

2' '

)

Figure 2-7. Algorithm LMF 2.2.3 Smallest Machine First (SMF)

The introduction of SMF algorithm can be compared with LMF algorithm; this is because the execution steps are the same as LMF algorithm. The only difference is their method of sorting the processors. Just by looking at the name, we can see that the allocating order of SMF algorithm is to set the resources with the least processors in the front. We still use the example used in Naive algorithm, the resources order here is sorted according their processor amount, which is Resource2→Resource1→Resource4→Resource3. The remaining steps are the same as LMF algorithm; it’s just that the resources are sorted according to their processor amount, from small to big. Fig. 2-8 for the execution process and Fig. 2-9 for the

details of SMF algorithm.

The advantage of this algorithm is: (1) when the job scheduling within the job list uses SMF algorithm, the possibility for jobs becoming sub-jobs decrease and the communication cost between sub-jobs decrease. The disadvantage is: (1) when job scheduling begins, the chance of a job being cut into sub-jobs and the amount of sub-jobs will increase, thus increasing the communication cost between them.

Initial Resource1 4

Resource2 2 Resource3 16 Resource4 8

Step 1: Job_1

Resource2 2 Resource1 4 Resource4 8 Resource3 16

Resource2 0 Resource1 4 Resource4 8 Resource3 16

Step 2: Job_2

Resource2 0 Resource1 4 Resource4 8 Resource3 16

Resource2 0 Resource1 0 Resource4 4 Resource3 16

If Step 3

Resource2 0 Resource1 0 Resource4 4

Resource3 16

… …

Figure 2-8. Example of SMF Algorithm Job_1 needs 2 PEs

Resource1: 2 Resource2: 0 Resource3: 0 Resource4: 0

Job_2 needs 8 PEs Resource1: 4 Resource2: 0 Resource3: 0 Resource4: 4

Input: s and i

(

2' '

)

Figure 2-9. Algorithm SMF 2.2.4 Minimum Effective Execution Time (MEET)

The goal of the MEET algorithm [17] proposed by Dr. Keqin Li is: when a job enters scheduling, try to minimize its effective execution time. The processing procedure of MEET algorithm are: every resource is sorted in order according to their amount of processors from big to small, find the resources that can provide enough processors for the job to execute, then evenly distribute the job to these different resources. MEET algorithm can avoid jobs splitting into too small sub-jobs and resulting in large communication times; it also conserves the resources that have more processors. See Fig. 2-11 for the details of MEET algorithm. We will then use a simple example to further explain this type of algorithm.

Suppose there are four resources in the Grid environment; Resource1 has eight processors, Resource2 has two processors, Resource3 has five processors, and Resource4 has six processors. A job that needs sixteen processors appears. The process for algorithm execution is listed below, see Fig. 2-10 for a diagrammatic illustration:

1. The resources are sorted according to their processor amount, from big to small. The order is Resource1→Resource4→Resource3→Resource2.

2. Whenr=1, splitting the job into one piece. Yet no resource can satisfy it.

3. Whenr=2, splitting the job into two pieces. Yet no two resources can provide the processors needed.

4. When r=3 , splitting the job into three pieces. Resource3, Resource4, and Resource1 can provide five processors. Since Resource2 does not enough processors, it cannot save Resource1 which has more processors. Therefore, Resource3, Resource4, and Resource1 can each provide five processors. A last processor is still needed, yet it cannot be provided by Resource3. Therefore, Resource4 will have to provide the last one processor. In the end, Resource3 has provided five processors, Resource4 has provided six processors, and Resource1 has provided five processors.

5. When the next job arrives, the resources will be sorted again, according to their processor amount, which is Resource1→Resource2. Yet the job will have to pass the estimation of the job scheduling algorithm.

The advantages of this algorithm are: (1) it can avoid jobs being split too small and production of overlarge communication cost; (2) it can conserve the resources with more processors. The disadvantage is: (1) it only uses computation and no communication for computing, it may increase unnecessary communication cost.

Initial Resource1 8

Resource2 2 Resource3 5 Resource4 6

Step 1: Job_1 (r =1) Resource1 8

Resource4 6 Resource3 5 Resource2 2

Step 1: Job_1 (r =2) Resource1 8

Resource4 6 Resource3 5 Resource2 2 Step 1: Job_1 (r =3)

Resource1 8 Resource4 6 Resource3 5 Resource2 2

Resource1 3 Resource4 0 Resource3 0 Resource2 2

If Step 2

Resource1 3 Resource2 2 Resource3 0

Resource4 0

… …

Figure 2-10. Example of MEET Algorithm Job_1 needs 16 PEs

No resources matched

Job_1 needs 16 PEs No resources matched

Job_1 needs 16 PEs Resource1: 5 Resource4: 5+1 Resource3: 5+0 Resource2: 0

Input: si and

(

2' '

)

Figure 2-11. Algorithm MEET

相關文件