gridsim installation and implementation process

228 downloads 0 Views 13MB Size Report
NEERAJ RATHORE. ABSTRACT. GridSim is a famous Java-based grid simulator with a clear focus on Grid environment. This simulator is based on entities:.
RESEARCH PAPERS

GRIDSIM INSTALLATION AND IMPLEMENTATION PROCESS BY BY NEERAJ RATHORE Department of Computer Science & Engineering, Jaypee University of Engineering & Technology, Guna, Madhya Pradesh, India.

ABSTRACT GridSim is a famous Java-based grid simulator with a clear focus on Grid environment. This simulator is based on entities: Grid users, brokers (bargaining on behalf of users) and resources. These entities can have customized characteristics. In this paper, the author has been discussed about how to creating a Grid Resource, Users, Gridlets and Entities in GridSim to start the simulation as well as the submission and retrieving of Gridlets (job/task) to Grid Resources in GridSim. The author also introduce some enhancements in the GridSim. Machine Entity (ME) is treated as a dump entity object in GridSim 4.0 and is not able to participate in any decision making activities. The author has proposed that the ME should be active and should participate in load balancing at its level. In order to implement Load balancing model, the author has developed an application which uses the simulated the Grid environment i.e, GridSim. It has been implemented in the application by using Java programming language over the GridSim 5-2_2, to run the application completely on GridSim package. Keywords: GridSim, Load Balancing, Grid Resources, Gridlets, Machine Entity, Brokers. INTRODUCTION

balancing algorithm has been implemented in the

Peer-to-Peer/Grid computing has emerged as a potential

GridSim as a reference using following steps to create

next generation platform for solving large-scale problems

each and every entity required to run the application, are

in science, engineering, and commerce. It is expected to

as follows.

involve millions of (heterogenous) resources scattering

1. Creating Grid Users

across multiple organizations, administrative domains,

Steps to create Grid users in GridSim [1-10] are

and policies. The management and scheduling of

straightforward. For an application to have more than one

resources in such a large-scale distributed systems is

user, unique, User ID needs to be considered. In the next

complex and therefore, demands sophisticated tools for

step, when the Gridlets (jobs) are created at that time we

analysing and fine-tuning the algorithms before applying

need to specify the User ID to which the Gridlet (job)

them to the real systems [1-5].

belongs, therefore Grid user creation precedes Gridlet

Simulation appears to be the only feasible way to analyse

(job) creation. The steps to create a Grid User are as

algorithms on large-scale distributed systems of

follows and also shown in Figure 1.

heterogenous resources. Unlike, using the real system in

i.

real time, simulation works well, without making the analysis mechanism unnecessary complex, by avoiding the overhead of co-ordination of real resources. Simulation is also effective in working with very large hypothetical problems that would otherwise require involvement of a large number of active users and resources, which is very hard to coordinate and build at large-scale research environment for investigation purpose [1].

Create an object of type ResourceUserList. ResourceUserListuserList = new ResourceUserList();

ii.

The above class will create a user list, that will contain the list if users who are active. Add to this list Grid users specifying a unique ID, first user has to have ID equal to 0. Just keep on adding Grid users to this list if we wish to create to more of them. We need to give the user id for each of the users, with the following command. userList.add (0);

To understand the whole GridSim mechanism, Load

i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

29

RESEARCH PAPERS

Figure 1. Grid Resource Creation in GridSim

2. Creating Gridlets (jobs)

The steps to create Gridlet(s) in manual modes are as

In the terminology of GridSim, a job which can run

follows and also shown in Figure 3.

sequentially and independently on a Grid Resource is

2.1 Manual Steps to Create Gridlets

called a Gridlet. After the creation of Grid Resource we

Step 1:

create Gridlets in the GridSim and then submitted. The job which can run on a Grid resource is called as Gridlet. Every Gridlet has a unique ID, which is different from another. The user provides the number of Gridlets that needs to be created, then for each Gridlet its length, file size, output file size needs to be specified. We need to specify the length of Gridlet, its output file size, its input file size, its unique ID for simulation. Gridlet [5-17] creation can be

Firstly, specify the file size, output file size, and length of the Gridlet Gridlet Gridlet1 = new Gridlet(id, length, file_size, output_size) Step 2: Then use Queue to keep the list of Gridlets. GridletList list = new GridleList ()

done in two modes, first is the manual option to take care

Step 3:

of the statistical needs of highly unpredictable Grid

Store the Gridlets into a Linked-list to keep the Gridlets

environment simulation [10-16]. Gridlets can be created

together.

in a manual way and secondly randomly generated. The steps to create Gridlets are as follows and also shown in

2.2 Randomly Steps to Create GridLets

Figure 2. First of all we need to create a list of Gridlets and for this we

Step 2:

GridletList list = createGridlet (); Now to create a container to store the Gridlets by using

30

Step 1: An object of type random is required

use the method

GridletList list = new GridletList ();

list.add(Gridlet1)

An object of Gridlet List is required. GridletList list = new GridleList();

i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

RESEARCH PAPERS

Figure 2. Creating Grid User in GridSim

Figure 3. Gridlets and Grid Users Creation

Step 3:

_range, max_range, random. next Double())

GridSimStandardPE needs to be set.

Gridlet Gridlet = new Gridlet(id, length, file_size,

Step 4:

output_size)

Randomly generate the length of the jobs, by using the

3. Creating a Grid Resource

standard PE to MIPS.

A Grid Resource simulated in GridSim contains one or

Step 5:

more machines. Similarly, a machine contains one or

Minimum and Maximum range of the file has to be set. Step 6: Following are the values that are created by GridSim Length = GridSimStandardPE.toMIs(random. next Double()*output_size) file_size = (long) GridSimRandom.real(100, min_range, max_range, random.nextDouble())

more PEs (Processing Elements or CPUs). Below are the steps to be followed in Java code to create a Grid Resource. 1. Create an object of type MachineList to store one or more Machines MachineListmList = new MachineList (); 2. A Machine contains one or more PEs. So, create an object of type PEList to store this PEs before creating a

output_size = (long) GridSimRandom.real(250, min i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

31

RESEARCH PAPERS Machine.

Characteristics. TIME_SHARED, time_zone, cost);

PEList peList1 = new PEList ();

7. In the final step, create an object of Grid Resource

3. Create PEs and add these into the object of PEList

specifying its name, communication speed, peak

created in step 2. Specify the unique ID of the PE as

load, off-peak load, holiday load and list of holidays

first parameter and its MIPS (Millions of Instruction per

along with the Resource Characteristics object which

Second) rating as second parameter.

was created in the step 6.

peList1.add (new PE (0, 377));

GridResourceGridRes= new GridResource (name,

4. Create a Machine with its unique ID and the PE List

baud_rate, seed, resConfig, peakLoad, offPeakLoad, holidayLoad, Weekends, Holidays);

associated with it.

4. Creating Grid Entities

mList.add (newMachine (0, peList1)); 5. Repeat the steps from step 2 to step 4 to create

It is used to start the actual simulation. Till now, we have successfully created Grid Resource(s), Grid User(s) and

additional number of machines. 6. Create a Resource Characteristics object which will store the properties of a Grid Resource, its architecture, Operating System, List of Machines, Allocation Policy which can be Time Shared or Space Shared, Time Zone and Cost of the Resource in terms of $ per PE Time Unit.

Gridlet(s) in GridSim. To actually start the simulation in GridSim, we need to create GridSim entity, without this we get a Null pointer Exception at runtime. Hence, we use the method GridSim.init() which takes parameters as: Calendar Type Instance, Trace Boolean Flag with which we can control the tracing of GridSim Events, List of files or processing names to be excluded from any statistical

Resource Characteristics resConfig = new Resource Characteristics (arch, os, mList, Resource

measures and report name. Figure 4 describes the resultant Figure.

Figure 4. Grid Entity Creation in GridSim

32

i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

RESEARCH PAPERS

Figure 5. Gridlet Submission in GridSim

String [] exclude_from_file = {"" }; String [] exclude_from_processing = {"" }; String report_name = null; GridSim.init (num_user, calendar, trace_flag, e x c l u d e _ f ro m _ f i l e , e x c l u d e _ f ro m _ p ro c e s s i n g , report_name); 5. Submission of Gridlet(s) to Grid Resource(s) The steps to be followed to submit the Gridlets to the Grid Resources also shown in Figure 5: 1. Since GridSim package uses multi-threaded environment the request for list of Grid Resources might arrive earlier before one or more Grid Resource Entities manage to register themselves to Grid

super.send (resourceID, GridSimTags.SCHEDULE_ NOW, GridSimTags.RESOURCE_CHARACTERISTICS, this.ID_); resChar = (ResourceCharacteristics) super. receiveEvent Object(); resourceName = resChar.getResourceName (); 4. From the Gridlet list take a Gridlet at a time and then submit to the Grid 5. Resource Entity with the Grid Resource ID to which intends to submit. The last parameter in the method call below signifies that need an acknowledgement for Gridlet successful submission. SuperGridletSubmit(Gridlet, resourceID[id], 0.0,

Information Service (GIS) entity. Therefore we wait for

true);

some micro seconds using the Hold method of

6. Record the statistics in the GridSim report.

GridSim Class.

7. Repeat the steps 5 and 6 according to the number of

2. The GIS will return only the Grid Resource IDs. 3. Using the ID obtained in step 2 retrieve Resource Characteristics from Resource Entity.

Grid Resources and Gridlets. 8. Create a list of type Gridlet List to keep a record of Gridlets submitted.

i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

33

RESEARCH PAPERS

Figure 6. Gridlet Retrieval in GridSim

6. Retrieving Back of Gridlet(s) from Grid Resource(s)

GridSim.shutdownUserEntity ();

Figure 6 and Figure 7 shown to receive back finished

GridSim.terminateIOEntities ();

Gridlets from Grid Resources in the following steps:

8. How to Use GridSim Package

1. Create empty List of type Gridlet List named as

In previous sections, the authors has described how to

Received list

create users, Gridlets and resources in GridSim, now, need

2. For each Gridlet submitted call the method

to know how to use GridSim packages and how a Grid user

Gridlet = (Gridlet) super.receiveEventObject (); 3. Add this Gridlet to the received List created in step 1 4. Repeat the steps 2 and 3 for all the Gridlets submitted. 5. Then compare the received list with the submitted list.

submits it's Gridlets to Grid resources, shown in Figure 8. The steps are as follows: Step 1: Gets an ID for this entity this.ID_ = new Integer( getEntityId(name) );

7. Shutting Down Simulation in GridSim To shut down the simulation in GridSim three methods has

Step 2:

been used, they internally clear all the buffers, release all

Create a list of Gridlets or Tasks for this Grid user

the files and written reports.

this.list_ = createGridlet( this.ID_.intValue() );

GridSim.shutdownGridStatisticsEntity ();

34

Step 3: i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

RESEARCH PAPERS

Figure 7. Gridlet Info Retrieval in GridSim

Figure 8. GridSim packages

The method that handles communications among

Requests to resource entity to send its characteristics

GridSim entities. Waiting to get list of resources, Resource

Step 5:

list contains list of resource IDs not Grid resource objects. resourceID[i] = ( (Integer)resList.get(i) ).intValue(); Step 4:

Waiting to get a resource characteristics resChar = (ResourceCharacteristics) super.receive EventObject();

i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

35

RESEARCH PAPERS

Figure 9. Workload Window

Figure 10. Resource Window

9. Workload and Grid Resource Entities

Creates one or more Grid Resource entities having total

The Workload entity sends Gridlets to a particular Grid

number of Grid resources, rating of each PE, total number

Resource entity. The steps are as follows:

of PEs for each Machine, number of Machines etc., and add a resource name into an array

Step 1: Initialize the GridSim package. It should be called before

resArray[i] = resName;

creating any entities. Any program can't run without

Step 3:

initializing GridSim otherwise got run-time exception error.

Get the list of trace files. The format should be text, gzip or

Step 2:

zip.

36

i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

RESEARCH PAPERS

Figure 11. PE Level Window

Figure 12. Submit Gridlets

Step 4:

Workload entity can only read one trace file and submit its

Creates one or more Workload trace entities. Each

Gridlets to one Grid resource entity.

i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

37

RESEARCH PAPERS

Figure 13. Move Gridlets

Figure 14. Output Window

Step 5:

file has to be changed such as machine.java in GridSim package. A calculation which is required has been done

Starts the simulation by using

in this module. Implement the algorithms by using the

GridSim.startGridSimulation();

create Grid Resource, Resource Characteristics, Machine

Step 6:

(i, a, MIPSRating), Machine List () methods etc. as

Prints the Gridlets when simulation is over.

described above. Figure 9 and Figure 10 related to output

To implement in specific algorithm in GridSim few source 38

are given below:

i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

RESEARCH PAPERS From above output Figures, it is clear that the number of

The GridSim toolkit software with source code can be

machines, PEs and grid let's give by user, Current Load at

downloaded from the project website [1]: http://www.

PE ID 0 is shown in output Figure 11, where current load is

buyya.com/gridsim/

estimated by summing of file size of griddled divided by

References

the actual capacity of PE (i.e. Rating).

[1]. Rajkumar Buyya and Manzur Murshed, (2002).

The output shown in Figure 11 indicates that the resource

“GridSim: A Toolkit for the Modeling and Simulation of

has 3 Machines (with ID 0, 1 and 2) and Machine Id-2 has 6

Distributed Resource Management and Scheduling for

PEs. Load at each PEs is shown in the Figure 11, by using

Grid Computing”. Vol. 14, No.13, pp.1175-1220.

this load, differentiate the PEs in different categories. From this output it is clear that 3 PEs are under lightly loaded and 3 PEs are in overloaded category. Each list holds PE ID and PE Load. List and list size is shown in the Figure 11. Figure 12 to Figure 14 are the output of the Test.java program (in which need to pass two arguments (for space shared) and 5 (denotes test number 5). After creation of resources and users actual process is started, and a user has been submitted his grid lets to resources as shown in the Figure 12. Some users require acknowledgement of their jobs also as shown in the Figure 8. Resources' move their grid lets to another lightly loaded resource. Information related to the Gridlets such as Gridlet ID, status, resource Id in which Gridlets runs and their total execution time is shown in Figure 14. Conclusion The author has discussed GridSim installation and implementation process for resource modeling and scheduling simulation. GridSim simulates time and space shared resources with different capabilities, time zones, and configurations. It supports different application models that can be mapped to resources for execution by developing simulated application schedulers. The author has discussed the creation of Grid User, Gridlets, Grid Resources, Grid entities of the GridSim toolkit along with steps involved in submission and retrieval of Gridlets to Grid resources and Grid resources to Gridlets respectively. Proper use of GridSim packages and workload entries has been shown in this paper. In this way,

[2]. Rathore, N. K., and I. Chana, (2011). "A cogitative analysis of load balancing technique with job migration in grid environment”. IEEE proceedings paper, pp. 77-82. [3]. Rathore, Neeraj, and Inderveer Chana, (2015). "Variable threshold-based hierarchical load balancing technique in Grid." Engineering with Computers, Vol. 31, No. 3, pp. 597-615. [4]. Rathore, Neeraj and Inderveer Chana, (2013). “A sender initiate based hierarchical load balancing technique for grid using variable threshold value”. Signal Processing, Computing and Control (ISPCC), 2013 IEEE International Conference on. IEEE. [5]. Rathore, Neeraj, and Inderveer Chana, (2014). “Load balancing and job migration techniques in grid: a s u r v e y o f r e c e n t t r e n d s ” . W i r e l e s s Pe r s o n a l Communications, Vol. 79, No. 3, pp. 2089-2125. [6]. Neeraj Rathore and Inderveer Chana, (2013). Report on Hierarchical Load Balancing Technique In Grid Environment. i-manager's Journal on Information Technology, 2(4), Sep-Nov 2013, Print ISSN 2277-5110, EISSN 2277-5250, pp. 26-40. [7]. Sharma, Vishal, Rajesh Kumar, and Neeraj Rathore, (2015). "Topological Broadcasting Using Parameter Sensitivity-Based Logical Proximity Graphs in Coordinated Ground-Flying Ad Hoc Networks." Journal of Wireless Mobile Networks, Ubiquitous Computing, and Dependable Applications (JoWUA), Vol. 6, No. 3, pp. 5472.

Architecture of Grid Computing in which different types of

[8]. Rathore, Neeraj Kumar, and Inderveer Channa,

algorithm has been applied and get better results

(2010). "Checkpointing Algorithm in Alchemi .NET." ims.

according algorithm in Grid environment.

2010. http://www.iuu.ac/pragyaan/Pragyaan_IT_

Software Availability

June10.pdf

i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

39

RESEARCH PAPERS [9]. Neeraj Kumar Rathore and Inderveer Chana, (2008).

University, Patiala. Retrieved from http://hdl.handle.net

“Comparative Analysis of Checkpointing", PIMR Third

/10266/658 http://dspace.thapar.edu:8080/dspace

National IT conference, IT Enabled Practices and

/bitstream/10266/658/3/T658.pdf

Emerging Management Paradigm book and category is

[14]. N Rathore and I Chana, (2016). “Job Migration

Communication Technologies and Security Issues, pp

Policies for Grid Environment", Wireless Personal

no.-32-35, Topic No/Name-46, Prestige Management

Communication, Springer Publication-New-York (USA),

and Research, Indore, (MP) India. Retrieved from https://

ISSN print 0929-6212, ISSN online 1572-834X, IF -0.979,

books.google.co.in/books?hl=en&lr=&id=5qb9sCXdB

DOI: 10.1007/s11277-016-3264-2.

QYC&oi=fnd&pg=PA321&ots=Ht0sJ23gh5&sig=3h_ro m31i5LMVcXV54KYN_6J4ng&redir_esc=y#v=onepage &q&f=false

[15]. Neeraj Rathore, (2016). Ethical Hacking and Security Against Cyber Crime, i-manager's Journal on Information Technology, 5(1), Dec 2015-Feb 2016, Print ISSN 2277-

[10]. Neeraj Rathore, (2015). Efficient Agent Based Priority Scheduling and Load Balancing Using Fuzzy Logic in Grid Computing . i-manager's Journal on Computer Science, 3(3) Sep - Nov 2015 Print ISSN 2347–2227, E-ISSN 2347–6141, pp. 11-22.

5110, E-ISSN 2277-5250, pp.7-11. [16]. Neeraj Kumar Rathore and Inderveer Chana, (2010). “Checkpointing Algorithm in Alchemi.NET" in Lambert Academic Publication House (LBA), Germany ISBN-10: 3843361371, ISBN-13: 978-3843361378 in 22-

[11]. Rathore, Neeraj, and Inderveer Chana, (2014).

Oct-2010. Retrieved from https://www.lap-publishing.

"Job migration with fault tolerance based QoS scheduling

com/catalog/details/store/gb/book/978-3-8433-6137-

using hash table functionality in social Grid computing."

8/checkpointing-algorithm-for-alchemi-net-in-grid

Journal of Intelligent & Fuzzy Systems, Vol. 27, No. 6, pp. 2821-2833.

[17]. Neeraj Kumar Rathore and Anuradha Sharma, (2015). “Efficient Dynamic Distributed Load Balancing

[12]. Neeraj Rathore, (2015). Map Reduce Architecture

Technique", in Lambert Academic Publication House,

for Grid, i-manager's Journal on Software Engineering,

Germany , Project ID: 127478, ISBN no-978-3-659-78288-

10(1), Jul-Sep 2015, Print ISSN 0973-5151, E-ISSN 2230-

6 in 19-Oct-2015. Retrieved from https://www.lap-

7168, pp.21-30.

publishing.com/catalog/details//store/gb/book/978-3-

[13]. Neeraj Rathore, ME thesis “Implementing

659-78288-6/efficient-dynamic-distributed-load-

Checkpointing Algorithm in Alchemi .NET”, Thapar

balancing-technique

ABOUT THE AUTHOR Dr. Neeraj Rathore is currently working as an Assistant Professor in the Department of Computer Science and Engineering at Jaypee University, Guna, Madhya Pradesh, India. He obtained his Ph.D in the Department of Computer Science with specialization in Grid Computing and received M.E. Degree in the Department of Computer Engineering from Thapar University. His areas of interests include Parallel and Distributed Computing, Grid Computing, DBMS and Data Structure. He has over 30 publications in International Journals and Conferences.

40

i-manager’s Journal on Cloud Computing, Vol. 2 · No. 4 · August - October 2015

Suggest Documents