Heuristic Scheduling Strategies for Linear-Dependent and Independent Jobs on Heterogeneous Grids Min-Yi Tsai, Ping-Fang Chiang, Yen-Jan Chang, and Wei-Jen Wang* Department of Computer Science and Information Engineering, National Central University, Taoyuan 320, Taiwan
[email protected]
Abstract. Grid computing came into being an active research area because of the advances in wide-area network technologies and the low cost of computing resources. One motivation of grid computing is to aggregate the power of distributed resources and integrate the resources into a unified platform. To minimize the total completion time of the submitted computing jobs to a grid platform, people employ various scheduling algorithms to dispatch the jobs to the resources. However, it has been proved that the optimal scheduling algorithm is NP-hard. Therefore, many people turn to use heuristic approaches for grid scheduling. In this paper, we introduce ten common scheduling heuristics to schedule a combination of job-chains (linear-dependent jobs) and independent jobs on a heterogeneous environment. We implemented these methods on a grid simulator to evaluate their performance under different circumstances. The results of scheduling job-chains and independent jobs on a heterogeneous environment are quite different from previous studies, and we provide our explanations for the differences. We also propose a hybrid method based on our observation, and the simulation results show that it has good performance in terns of makespan. Keywords: Job scheduling, Grid computing, Heuristics, Job dependency.
1
Introduction
With the development of science and technology, the computing power of a CPU has become more powerful; moreover the number of cores in the CPU keeps increasing in the past decade as well. Grid computing technology [1] can be used to integrate these distributed resources into a more powerful, unified system. By coordinating the scheduler, a grid system automatically and efficiently finds appropriate computing nodes. Then, it can assign and transfer jobs that are waiting for execution to available nodes. In a typical grid system, a scheduler may schedule dependent jobs and independent jobs. A set of independent job can be executed without any constraints, while a series of dependent jobs must follow some order to complete those jobs.
*
Corresponding author.
T.-h. Kim et al. (Eds.): GDC 2011, CCIS 261, pp. 496–505, 2011. © Springer-Verlag Berlin Heidelberg 2011
Heuristic Scheduling Strategies for Linear-Dependent and Independent Jobs
497
According to the dependency relationship, dependent jobs can form job-chains (linear-dependent jobs) or DAG (directed-acyclic-graphical). According to the above considerations, a great deal of algorithms and mechanisms for job scheduling had been proposed in the past [2-6]. Job scheduling on parallel and distributed computing systems is a hard problem. Under multi-processor systems, a typical job scheduling problem is proved to be NP-complete [7]. As a result, many heuristics has been proposed in the past decades to improve efficiency of the job schedule problems. These heuristics may focus on different considerations of situations and constraints. For example, some heuristics, such as the longest-job-first heuristic, have good completion time (makespan) while scheduling job-chains [4] on a heterogeneous environment. Sahu et al. [6] found out that the min-max method has the best makespan while scheduling independent jobs on a homogeneous environment. To minimize the makespan of the system, this paper proposes a hybrid scheduling method that achieves good makespan under most circumstances. The proposed scheduling method combines the max-min method and the longest-job-first method to schedule a combination of job-chains and independent jobs. This Hybrid method can reduce the constraints that single heuristic may face under some specific situations. Therefore, the proposed method can adapt to heterogeneous environments while scheduling a set of jobs. We have implemented several heuristic scheduling methods on grid simulator, namely GridSim [8], conducted experiments to evaluate the performance of several commonly-used heuristics, and compared them with the proposed hybrid method using a set of job-chains and independent jobs on a heterogeneous environment. The rest of the paper is organized as follows. Section 2 describes the background of this study and some related work. Section 3 shows the simulation results of ten heuristic scheduling methods on a heterogeneous environment to schedule job-chains and independent jobs. Section 4 describes the proposed hybrid method and Section 5 provides the experimental results. Finally, Section 6 gives concluding remarks.
2
Background
This section will briefly introduce the concept of the objective of grid scheduling, and the related work of this research. 2.1
Scheduling Objectives
The essence of grid scheduling can be formulated into an optimization problem involving several objective functions, such as makespan (completion time), flowtime, resource utilization, matching proximity, and algorithm computation time [6]. Among those objectives, makespan is the most popular objectives to optimize, and this paper focuses on the problem of makespan optimization on a heterogeneous environment. Makespan represents the time from the first executing job to the last finished job. Let Cj represent the makespan of 1 ≤ j ≤ n. Then, the makespan optimization problem is to minimize the following equation:
498
M.-Y. Tsai et al.
Cmax = MAX {Cj | 1 ≤ j ≤ n} 2.2
(1)
Heuristic Methods for Grid Scheduling
Many heuristic scheduling algorithms [4-6] have been employed to improve the performance of grid scheduling. The subsection will describe some common heuristic algorithms. Note that most heuristic methods are originally proposed for independentjob-scheduling. Those heuristic strategies must be modified to support job-chain scheduling. • Minimum Completion Time (MCT): The MCT algorithm randomly chooses a job that is ready for execution, and computes the finish time of the job on each machine. The job is then assigned to the machine with the smallest finish time. • Min-Min: The min-min algorithm is based on the MCT algorithm. The MCT algorithm considers one job at a time while min-min considers all unscheduled jobs. The purpose of the min-min algorithm is to assign as many jobs as possible to the fastest machine. Thus, it can minimize the overall makespan. • Max-Min: The max-min algorithm is a variation of min-min. The min-min algorithm selects the job with the minimum completion time. However, max-min chooses the job with the largest minimum-completion-time. The goal of max-min algorithm is to reduce the cost of executing the job with long minimum completion time. • Min-Max: The min-max heuristic calculates the minimum completion time and the minimum execution time (MET) for every unassigned job, and then selects the job with the largest ratio of MCT to MET. • Longest-Job-First (LJF): The goal of the longest-job-first method is to reduce the total makespan by preventing the job with longest execution time from being the late-time bottleneck. To achieve this goal, the longest-job-first method schedules the longest job to the earliest machine that can process the job. If many machines are available at the same time, the method always picks the fastest machine. • Shortest-Job-First (SJF): The shortest-job-first method schedules the shortest job to the earliest available machine that can process the job. If many machines are available at the same time, the method always picks the fastest machine. • Opportunistic-Load-Balancing (OLB): The method chooses the earliest idle machine, and randomly picks an unassigned job for execution. • Suffrage: Suffrage for a job is the difference between second-best minimum completion time and the best minimum completion time. The job with the maximum suffrage value is assigned to the machine that gives the best minimum completion time. • Work Queue (WQ): The method randomly selects a job and assigns it to the machine with the minimum workload. • Average-Execution-Time (AET): The method is dedicated for job-chains. It assigns an entire job-chain to a machine for execution. It calculates the averagejob-size of each job-chain, and then uses LJF to schedule the job-chain that has the largest average-job-size.
Heuristic Scheduling Strategies for Linear-Dependent and Independent Jobs
2.3
499
Related Work on Analysis of Heuristic Scheduling Methods
Many researchers have been conducted many experiments and simulations to evaluate the performance of scheduling heuristics. Braun et al. [5] evaluated eleven heuristic methods for independent-job-scheduling on a heterogeneous environment. They found that the genetic-based algorithm, min-min. and duplex (a hybrid of min-min and min-max) are among the best scheduling strategies. Lin et al. [4] pointed out that, to schedule job-chains (linear-dependent jobs) on a heterogeneous environment, longest-job-first is the best strategies among average-execution-time, and shortestjob-first. Sahu et al. [6] evaluated twelve heuristic methods for independent-job scheduling on a homogeneous environment. They indicated that, in the category of makespan comparison, min-min, min-max, suffrage, and RC (Relative Cost that considers both the load balancing of machines and the execution time of jobs) are among the best. The results also showed that min-max is the best among the min-min, min-max, suffrage, and RC.
3
Preliminary Analysis for Ten Scheduling Heuristics
In this section, we will show the simulation results for the ten scheduling heuristics described in Subsection 2.2. We implemented these scheduling heuristics on a grid simulator, namely GridSim [8, 11] to evaluate their performance. We devised several cases for scheduling job-chains and independent jobs on a heterogeneous environment, simulated those cases, and compared the results of using different scheduling strategies in those cases. 3.1
Supporting Scheduling for Job-Chains
Nine of the ten scheduling heuristics described in Subsection 2.2 are not able to schedule job-chains directly, and only the AET strategy can schedule both job-chains and independent jobs. To support the ability to schedule job-chains in the remaining nine scheduling heuristics, we enforce dependency checking in each of them. The concept of the procedure is shown as follows: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
let k be a small constant value for each unscheduled job J that is ready to be executed calculate the cost of scheduling J to a machine M using the heuristic strategy find the best pair of J and M using the heuristic strategy if J has a preceding job I then if I.finish_time > J.start_time then J.start_time = I.finish_time + k set J to be executed at J.start_time in M update the earliest available time of M goto Line 2 until all jobs are scheduled
500
M.-Y. Tsai et al. Table 1. Simulation parameters
Parameter Total amount of jobs Job size Total amount of nodes Computing power of a node Times of simulation
3.2
Value 512 Random( 1~999999 ) million instructions 10 Random (1000, 2000, …, 10000) MIPS 100
Preliminary Simulation Results on Heterogeneous Environments
We have designed three simulation cases for scheduling independent jobs and jobchains in a heterogeneous environment. The goal is to find the best scheduling strategy among the ten scheduling heuristics under different circumstances. The parameters of our simulations are shown in Table 1. The total amount of jobs is fixed at 512, and each job has a random size. The job size represents the number of instructions to be executed, and it ranges from 1 to 999999 million instructions. The jobs are scheduled on a heterogeneous environment consisting of 16 nodes. Each computing node has random processing power. The computing power of a grid node is set to 1000n MPIS, where n ranges from 1 to 10. To obtain the result of a particular simulation case, we simulate it a hundred times and take the average of the simulated makespan values as the result. The first simulation case (Case 1) is to schedule 512 independent jobs on a cluster consisting of heterogeneous computing nodes. Figure 1 shows the makespan values of different heuristic strategies. The simulation result indicates that LJF and AET are the best for scheduling independent jobs on a heterogeneous environment; min-min, SJF, and WQ are the relatively bad scheduling strategies. Note that AET has the same behavior as LJF while scheduling independent jobs. The max-min strategy also works well in this simulation case since its behavior is similar to the LJF strategy. The result shows that the longest-job-first strategy, used by LJF, AET, and maxmin, works well for scheduling independent jobs on a heterogeneous environment. On the contrary, min-min and SJF schedule the shortest job to the earliest available machine. Thus, they may increase the chance of running bigger jobs on slower machines, which results in a larger makespan. The WQ always allocates jobs to the machine with the minimum workload and doesn’t consider the completion time for each job on every machine, So, a slow machine has a higher chance to execute a large job and greatly increases the makespan. The second simulation case (Case 2) is to schedule 64 job-chains, each of which consists of eight jobs, and the jobs are executed on a heterogeneous environment. According to Figure 2, when jobs are linear-dependent, LJF no longer performs well; the max-min strategy and the suffrage strategy become the best among the ten heuristics. Note that max-min does not always schedule the longest job first. It prefers the job that has the largest minimal-completion-time on the heterogeneous environment. The suffrage strategy has similar behavior to the max-min strategy since it utilizes the information of the largest minimal-completion-time of a job. Therefore,
Heuristic Scheduling g Strategies for Linear-Dependent and Independent Jobs
501
its performance is relatively good in Case 2. The min-max strategy and the min-m min strategy do not work welll in this case. The result of Case 2 indicates that, whhile scheduling job-chains in thee heterogeneous environment, a scheduling method shoould first consider the job with th he largest minimal-completion-time. The third simulation case (Case 3) is to schedule a set of job-chains onn a heterogeneous environmentt. Each job-chain consists of a normally distributed randdom number of jobs, given the average to be 3 and the standard deviation to be 1. T The simulation result is shown n in Figure 3. The simulation result of Case 3 show ws a similar result to Case 2. Th hat is, max-min and suffrage are the better choices, whhile min-min and min-max are the t worse choices.
Fig. 1. Case 1: th he simulation result of scheduling independent jobs
Fig. 2. Case 2: the result of o scheduling job-chains, each of which consists of eight jobs
502
M.-Y. Tsai et al.
mally Fig. 3. Case 3: the result off scheduling job-chains, each of which consists of a norm distributed random number of jobs j
The results of Cases 1-3 3 show that a heterogeneous environment favors the L LJFbased strategies, especially the max-min strategy. This finding is consistent with Lin et al.’s study [4]. On the contrary, c a homogeneous environment favors the SJF-baased strategies, especially the min-min m strategy [5]. Our simulation results, which are not provided the paper, also co onfirm the results by Sahu et al [6]. However, the studyy by Braun et al. [5] is quite diffferent from our observation since they found that min-m min is a better solution. Our ex xplanation is that, the simulation models are different and thus the simulations producced different results. The simulation model in Braun et aal.’s study assumes task hetero ogeneity, making the execution time of a particular job almost unrelated to the com mputing power of a machine. For example, the executtion time on Machine 1 for Job b A and Job B can be 25137.5 and 399562.1 respectively, while the execution time on n Machine 2 can be 30802.6 and 58987.9 respectively. T This assumption favors SJF-baased strategies since longer minimum completion tiime usually implies wasting of time. t
4
The Proposed Hybrid H Method
Base on the simulation resu ults described in Section 3, we can conclude that LJF is the best while scheduling indeependent jobs on a heterogeneous environment, and m maxmin is the best while sched duling job-chains. Thus, we propose a new hybrid methhod using these two heuristic methods. m The strategy is simple. First, the proposed methhod examines whether a job is linear-dependent or not. Second, this hybrid method uuses LJF to schedule independent jobs and the uses max-min to schedule job-chains. T The algorithm can be expressed as follows: 1. 2. 3. 4. 5.
let k be a small constaant value for each unscheduled d independent job J that is ready to be executed use LJF to find thee best pair of J and M set J to be executed in nM update the earliest avaailable time of M
Heuristic Scheduling g Strategies for Linear-Dependent and Independent Jobs
6. 7. 8. 9. 10. 11. 12. 13. 14. 15.
5
503
goto line 2 until all in ndependent jobs are scheduled for each unscheduled d dependent job J that is ready to be executed calculate the cost of o scheduling J to a machine M using max-min find the best pair of o J and M if J has a precedin ng job I then if I.finish_time > J.start_time then J.start_time = I.finish_time + k set J to be executed at J.start_time in M update the earliest avaailable time of M goto line 7 until all jo obs are scheduled
Preliminary Exp perimental Results
We used the same configurration described in subsection 3.2 for simulations. We hhave designed several schedulin ng scenarios to evaluate the performance of the propoosed hybrid method.
Fig. 4. Case 4: the simulation result of normal distributed job chain length with hybrid heuriistic
t simulation result of scheduling 20% job-chains Fig. 5. Case 5: the
504
M.-Y. Tsai et al.
t simulation result of scheduling 50% job-chains Fig. 6. Case 6: the
Fig. 7. Case 7: the t simulation result of scheduling 80% job-chains
First, we use the settin ng of Case 3 (each job-chain has a normally distribuuted length) to compare the pro oposed hybrid method with other heuristics. The propoosed hybrid method has the best makespan, as shown in Figure 4. It can save up to 2.5% % of the makespan compared with w the second best, suffrage. We also designed thhree different simulation scenarrios, Cases 5~7 to compare the proposed hybrid methhod with other heuristic methods. Case 5 is to schedule 20% of job-chains and 80% % of independent jobs, Case 6 is to schedule 50% of job-chains and 50% of independdent jobs, and Case 7 is to sched dule 80% of job-chains and 20% of independent jobs. E Each job-chain consists of five jobs in Cases 5~7. The simulation results are shownn in Figures 5~7 respectively. The T results indicated that the proposed hybrid method is a relatively better strategy. However, H the gain of using the proposed hybrid methodd is limited.
6
Conclusions
This paper used GridSim to t simulate and to demonstrate the results of ten comm mon heuristics for scheduling lin near-dependent jobs (job-chains) and independent jobs oon a
Heuristic Scheduling Strategies for Linear-Dependent and Independent Jobs
505
heterogeneous environment. From the simulation results, we figured out that LJF is the fastest method for scheduling independent jobs, and max-min is the best method for scheduling job-chains. The observation is different from previous studies that are conducted on homogeneous environments [6] or heterogeneous environments [5] to schedule independent jobs. We provided our explanations for the difference. We also proposed a hybrid heuristic method using LJF and max-min. The simulation results showed that the hybrid method demonstrates good performance values under most circumstances. When a job-chain has a random number of jobs or has a normally distributed number of jobs, the proposed hybrid method can still save up to 3% of makespan compared to the other ten scheduling method. Acknowledgments. This work was partially supported by the Nation Science Council of Republic of China under Grant No. 100-2218-E-008-005-. We are grateful to the National Center for High-performance Computing, Taiwan, for computer time and facilities.
References 1. Foster, I., Kesselman, C.: The Grid 2: Blueprint for a New Computing Infrastructure. Morgan Kaufmann Publishers Inc., San Francisco (2003) 2. Yu, J., Buyya, R.: A Taxonomy of Workflow Management Systems for GridComputing. Journal of Grid Computing 3(3), 171–200 (2005) 3. Du, J., Leung, J.Y.-T., Young, G.H.: Scheduling chain-structured tasks to minimize makespan and mean flow time. Information and Computation 92, 219–236 (1991) 4. Lin, P.-Y., Liu, P.: Job Scheduling Techniques for Distributed Systems with Temporal Constraints. In: Bellavista, P., Chang, R.-S., Chao, H.-C., Lin, S.-F., Sloot, P.M.A. (eds.) GPC 2010. LNCS, vol. 6104, pp. 280–289. Springer, Heidelberg (2010) 5. Braun, T.D., Siegel, H.J., Beck, N., Bölöni, L., Maheswaran, M., Reuther, A.I., Robertson, J.P., Theys, M.D., Hensgen, B.Y.D., Freund, R.F.: A comparison of eleven static heuristics for mapping a class of independent tasks onto heterogeneous distributed computing systems. J. Parallel Distrib.Comput. 61(6), 810–837 (2001) 6. Sahu, R., Chaturvedi, A.: Many-Objective Comparison of Twelve Grid Scheduling Heuristics. International Journal of Computer Applications 13(6), 9–17 (2011) 7. Ullman, J.D.: NP-complete scheduling problems. Journal of Computer and System Sciences 10, 384–393 (1975) 8. GridSim, http://www.cloudbus.org/gridsim/ 9. Al-ali, R.J., Amin, K., Laszewski, G., Rana, O.F., Walker, D.W., Hategan, M., Zaluzec, N.: Analysis and provision of QoS for distributed grid applications. Journal of Grid Computing 2(2), 163–182 (2004) 10. Krauter, K., Buyya, R., Maheswaran, M.: A taxonomy and survey of grid resourcemanagement systems. Software Practice and Experience 32, 135–164 (2002) 11. Sulistio, A., Cibej, U., Venugopal, S., Robic, B., Buyya, R.: A toolkit for modelling and simulating data Grids: an extension to GridSim. Concurr. Comput.: Pract. Exper. 20, 1591–1609 (2008)