Scheduling Algorithm for Grid Computing Using Shortest Job First with Time Quantum
Total Page:16
File Type:pdf, Size:1020Kb
Sudan University of Science and Technology Collage of Graduate Studies College of Engineering Scheduling Algorithm for Grid Computing using Shortest Job First with Time Quantum خوارزمية الجدولة للحوسبة الشبكية بإستخدام العمليات اﻷقصر أوﻻ مع الزمن الكمي A thesis submitted in partial fulfillment of the requirements for the degree of M.SC.in computer and networks engineering By: Raham Hashim Yosuf Supervised by: Dr. Rania A. Mokhtar August 2017 Initiation اﻷية قال هللا تعالى: {أَ َّم ْن ُه َو َقانِ ٌت آنَا َء اللَّ ْي ِل َسا ِجدًا َو َقائِ ًما َي ْحذَ ُر ا ْْل ِخ َرةَ َويَ ْر ُجو َر ْح َمةَ َربِ ِه قُ ْل َه ْل يَ ْستَ ِوي الَّ ِذي َن يَ ْع َل ُمو َن َوالَّ ِذي َن َﻻ َي ْع َل ُمو َن إِنَّ َما يَتَذَ َّك ُر أُولُو ا ْﻷَْلبَا ِب } صدق هللا العظيم سورة الزمر اْلية )9( I Dedication Dedicated to My parents, my sisters And to my friends To everyone who tried to guide me to A better life….. With my love II Acknowledgement My thanks for Allah After that I would like to thanks my university Sudan University of science and Technology and my college of Graduate Studies Electronics Engineering Department. And my teachers for inspiring me this project. I owe my profound gratitude to my thesis supervisor Dr. Rania A.Mokhtar for her valuable guidance, supervision and persistent encouragement. Due to the approach adopted by her in handling my thesis and the way she gave me freedom to think about different things, I was able to do the constructive thesis. By working under her I have gained priceless knowledge as to how to go about doing an effective research. My greatest thanks to my parents who for their continuous support. III Abstract One motivation of grid computing is to aggregate the power of widely distributed resources and provide non trivial services to users. To achieve this goal an efficient grid scheduling system is an essential part of the grid. The scheduling of the processes can be implemented in different ways with different scheduling algorithms. In this project we use Shortest Job First [SJF] algorithm where it assigns highest priority to shortest process. If processes are long, it suffers with a long waiting time. When shortest process continues to arrive, the longer process may never get a chance to schedule, this problem is called as Starvation. This research proposes a use of Shortest Job First with time quantum mechanism to overcome this issue. The MATLAB software is used to implement the proposed algorithm, the algorithm achieves better results than the original one in terms of delay time, resources utilization, fair treatment for all the processes and degree of starvation. IV ملخص البحث الهدف اﻷساسي من الحوسبة الشبكية هو اﻹستفاده القصوى من المصادر الموزعة وتقديم الخدمات غير البديهية للمستخدمين ولتحقييق هذا الهدف فإن نظام الجدولة هو جزء ضروري في الحوسبة الشبكية ﻷنه يعمل على جدولة العمليات بطرق مختلفة بناءا على العديد من الخوارزميات وإحدى هذه الخوارزميات هي خوارزمية تنفيذ العمليات القصيرة أو ًﻻ والعمليات اﻷطول تعاني من اﻹنتظار في الصف إلى أن يتم تنفيذ العمليات القصيرة. وعليه إذا إستمرت العمليات القصيرة في الوصول فإن العمليات الطويلة ﻻ تستطيع الدخول في الجدولة حتى يتم تنفيذها وتسمى هذه المشكلة بالتجويع ويقدم هذا البحث حﻻً لهذه المشكلة عبر خوارزمية العملية التي لها زمن تنفيذ أقل مع الزمن الكمي وتعمل هذه الخوارزمية على إختيار أسرع مصدر لتنفيذ العمليات التي لها زمن تنفيذ أقل ثم بعد أن يتم تنفيذها تقوم بتحرير المصدر وذلك إذا كان زمن تنفيذها أقل من أو يساوي الزمن الكمي، أما إذا كان زمن تنفيذها أكبر من الزمن الكمي فإنها تنفذ جزئياً ومن ثم يتم تقسيمها وتوزيعها علي المصادر الحرة اﻻخرى، أما إذا كانت كل المصادر مشغولة فإنها تحجب وترجع الى اخر الصف وتستمر عملية التنفيذ إلى أن تنفذ كل العمليات الموجودة في صف اﻹنتظار. V TABLE OF CONTENTS I .………………...............………………………………………………اْلية DEDICATION…………………………………………................………. II ACKNOWLEDGEMENT…………………............................................... III ABSTRACT…………………………………………..................……….. IV V .…………………..............……………………………………ملخص البحث Table of content………………………................……………………….. VI List of workspace……………………………..................……………….. IX List OF figures ……………………………..................…………………. X List of Tables ……………………………….................………………… XI List of Abbreviations……………… ……………………………………. XII Chapter one………………………………………………………………. 2 Introduction………………………………………………………………. 2 1.1 Preface……………………………………………………………..… 2 1.2 Problem statement…………………………………………………... 3 1.3 Proposed solution…………………………………………………….. 4 1.4 Objectives……………………………………………………............. 4 1.5 Scope……………………………………………………………….… 4 1.6 Methodology……………………………………………………….… 5 1.7 Research outlines ……………………………………………............ 5 Chapter two……………………………………………………………..... 7 2.1 Previous work………………………………………………………… 7 Chapter three……………………………………………………………… 14 3.1 Introduction ………………………………………………………….. 14 3.2 System algorithm ……………...………………………………….….. 14 3.3 Mathematical model …………………………………………….…… 15 Chapter four………………………………………………………….…… 18 4.1 Introduction…………………………………………………….…….. 18 4.2 Summary……………………………………………………………… 34 VI Chapter five……………………………………………………………… 36 5.1 Conclusion……………………………………………………………. 36 5.2 Recommendation……………………………………………………... 37 References…………………………………………………………….….. 38 Appendix I………………………………………………………………... 40 Appendix II………………………………………………………………. 52 VII List of workspace Workspace 4.1.1 Shortest Job First with time quantum ……………….. 19 Workspace 4.1.2Shortest Job First ……………………………………. 24 Workspace 4.1.3 Shortest Job First with time quantum when data rate is different …………………………………………………………………. 27 Workspace 4.1.4 Shortest Job First when data rate is different.……….. 31 VIII List of Figures Figure 4.1.1 Shortest Job First with time quantum …………..... 22 Figure 4.1.2 Shortest Job First ………………………………… 26 Figure 4.1.3 Shortest Job First with time quantum when data rate is different …………………………………………………… 29 Figure 4.1.4 Shortest Job First when data rate is different …....... 33 IX List of Tables Table 2.2 summary of related works……………………………..…… 11 Table 4.1.1 Shortest Job First time quantum …………………………. 21 Table 4.1.2 Shortest Job First ………………………………..……….. 25 Table 4.1.3 Shortest Job First with time quantum when data rate is different……………………………………………………..………..… 28 Table 4-4 Shortest Job First when data rate is different……………...... 32 X Abbreviations ABDRS: Agent Based Dynamic Resource Scheduling BAJGS: Bandwidth Aware Job Grouping based Scheduling B.T: Burst Time CPU: Central Processing Unit DJGBS: Dynamic Job Grouping Based Scheduling D-MMLQ: Deadline based Modified Multi Level Queue DR: Data Rate DT: Delay Transmission EDF: Earliest Deadline First EDSRT: Earliest Deadline First with Shortest Remaining Time ERD: Earliest Release Date FCFS: First Come First Service FF: First Fit GBFJS: Grouping Based Fire grained Job Scheduling GIS: Grid Information Service HJS: Hierarchical Job Scheduling HRN: Highest Response Next LJF: Longest Job First MFQS: Multilevel Feedback Queue Scheduling ORC: Optimal Resource Constraint RR: Round Robin SCTP: Stream Control Transmission Protocol SF: Starvation Free SFBAJG: Scheduling Framework for Bandwidth Aware Job Grouping SJF: Shortest Job First SPN: Shortest Process Next T.Q: Time Quantum VCGRP: Virtual Computing Grid using Resource Pooling XI Chapter one Introduction Chapter one Introduction 1.1 Preface Grid computing has emerged as a distributed methodology that coordinates the resources that are spread in the heterogeneous distributed environment[1].Grid computing is a type of parallel and distributed system that enables the sharing, selection and aggregation of resources distributed across multiple administrative domains based on their availability, capability, performance, cost and user’s quality-of-service requirements[2].Resources can be computers, storage space, instruments, software applications, channels and data, all connected through the Internet and a middleware software layer that provides basic services for security, monitoring and resource management. Resources owned by various administrative organizations are shared under locally defined policies that specify what is shared, who is allowed to access what, and under what conditions. In most organizations, there are large amounts of underutilized Computing resources. Grid computing provides a framework for exploiting these underutilized resources and thus has the possibility of substantially increasing the efficiency of resource usage. Grid computing looks like a great answer to numerous problems without prodigious management requirements [3]. 2 Effective grid computing is possible, however, only if the resources are scheduled well, the goal of the resource scheduler is to maximize the resource utilization and minimize the processing time of the jobs. The job scheduling system is responsible to select best suitable machines in a grid for user jobs. Schedulers allocate resources to the jobs to be executed using various algorithms such as First Come First Service [FCFS], Longest Job First [LJF], Earliest Deadline First [EDF] and other algorithms. One type of these algorithms is shortest job first [SJF] also know as Shortest Job Next [SJN] or Shortest Process Next [SPN] the scheduling technique that selects the smallest job. If process is long, then this long process are suffers with a long waiting time. When shortest jobs continue to arrive, longest jobs may never get a chance to schedule. This problem is called as Starvation. The project proposes a solution to overcome this issue with time quantum mechanism. SJF with time quantum is based on the integration of round robin and SJF scheduling algorithm. In